Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list to string

# Python program to convert a list 
# to string using list comprehension 

s = ['I', 'ate', 2, 'shake', 'and', 3, 'chocolates'] 

# using list comprehension 
listToStr = ' '.join([str(element) for element in s]) 

print(listToStr) 
Source by favtutor.com #
 
PREVIOUS NEXT
Tagged: #list #string
ADD COMMENT
Topic
Name
2+5 =