Mar-18-2018, 06:46 PM (This post was last modified: Mar-18-2018, 06:47 PM by snippsat.)
(Mar-18-2018, 04:09 PM)mp3909 Wrote: No because I want the commas to separate the list of my values but I just don't want the last comma
print() is only for display as it return None,so no way to save that list.
If you want a list that's comma separated.
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> [i for i in range(10)]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> # To a string with comma
>>> ','.join([str(i) for i in range(10)])
'0,1,2,3,4,5,6,7,8,9'