I have a list like this:
['0', '1', '1', '1', '2', '3', '4', '5', '7', '9']
I would like to print the items like :
0111234579
Can someone help how should I print out the items as I showed?
Thank you
I have a list like this:
['0', '1', '1', '1', '2', '3', '4', '5', '7', '9']
I would like to print the items like :
0111234579
Can someone help how should I print out the items as I showed?
Thank you
list1 = ['0', '1', '1', '1', '2', '3', '4', '5', '7', '9']
print("".join(list1))
it's easy
a=['0', '1', '1', '1', '2', '3', '4', '5', '7', '9']
for i in a:
print(i,end="")
write print(i,end=" ")
if you want a space between the elements.
or try print(*a,sep="")
use join list
list=[s ,o ,m ,e ,i ,t ,e, m ,s]
joinedlist="".join(list)
print(x) # prints with no spaces
# # # # with spaces # # # #
spacelist=" ".join(list)
print(spacelist)