Tags
Asked 2 years ago
13 Aug 2021
Views 231
Jayson

Jayson posted

How do I join a list into a string ?

How do I join a list into a string ?
shyam

shyam
answered Aug 14 '21 00:00

to join list into a string ,


lists=[[[1],[2]],[3]]*3
print(lists)
print()
s='i am string , and getting merged to lists  '
print(s+str(lists)


Output will be :

[[[1], [2]], [3], [[1], [2]], [3], [[1], [2]], [3]]

i am string , and getting merged to lists  [[[1], [2]], [3], [[1], [2]], [3], [[1], [2]], [3]]


so + can be used to join the list and string but we need to convert list to string by str() function
Post Answer