-4

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

4 Answers4

4
list1 = ['0', '1', '1', '1', '2', '3', '4', '5', '7', '9']
print("".join(list1))
ckunder
  • 1,920
  • 1
  • 10
  • 10
1
print(" ".join(arr))

Here arr is your list

Kevin Mayo
  • 1,089
  • 6
  • 19
gagangaur
  • 53
  • 6
0

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="")

-1

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)

Sashank
  • 557
  • 6
  • 20