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

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

c# - Get the Class name in a class with atribute inside a attribute method -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -