+ 1
Python list Problem
I want to print objects of the list in one line For example i have the list [1 , 2 , 3] I want to print it like this: 1 ,2 ,3 Pleas help!!!!
3 Réponses
+ 4
You can use the for loop to print it.
list=[1,2,3]
for i in list:
print(i,end=' , ')
Thanks
+ 3
Like Jay Matthews said, you could also do it like this:
', '.join(list)
Keep in mind that all the items in the list have to be strings or you will get an error
0
thanks!!!