python - How to print string and list on same row without square brackets -
l = [1, 2] print "my numbers are:", l
this gives me
my numbers are: [1, 2]
but want
my numbers are: 1, 2
i have seen ','.join(l)
don't know how print out on same line.
for .join
work have change every element str
:
print ', '.join(map(str, l))
Comments
Post a Comment