Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to make a list a string

# Python program to convert a list
# to string using list comprehension
   
s = ['I', 'want', 4, 'apples', 'and', 18, 'bananas']
  
# using list comprehension
listToStr = ' '.join([str(elem) for elem in s])
  
print(listToStr)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #list #string
ADD COMMENT
Topic
Name
5+5 =