-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

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

Here arr is your list

Kevin Mayo
  • 1,019
  • 5
  • 18
gagangaur
  • 63
  • 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
  • 491
  • 5
  • 16