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? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -