Consider this Python code for printing a list of comma separated values
for element in list: print element + \",\",
What is the preferr
That's what join is for.
','.join([str(elem) for elem in a])
>>> ','.join(map(str,a)) '1,2,3'