I\'m new to python (as well as stackoverflow) and I was wondering how I could print several values with commas in between them.
I\'m very well aware of the end
list1 = ['1','2','3','4']
s = ",".join(list1)
print(s)
print
also takes a sep
argument which specifies the separator between the other arguments.
>>> print(1, 2, 3, 4, sep=',')
1,2,3,4
If you have an iterable of things to print, you can unpack it with the *args
syntax.
>>> stuff_to_print = [1, 2, 3, 4]
>>> print(*stuff_to_print, sep=',')
1,2,3,4