Q:

python int list to 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)  
33
list1 = [1, 2, 3]
str1 = ''.join(str(e) for e in list1)
3
integers = [1, 2, 3, 4]
stringed = ''.join(map(str,new))
# stringed = "1234"
1
>>> L = [1,2,3]       
>>> " ".join(str(x) for x in L)
'1 2 3'
3
list1 = ['1', '2', '3']
str1 = ''.join(list1)
3
List = ["ITEM1", "ITEM2", "ITEM3"]
string_version = "".join(List)

print(string_version)
2
mystring = 'hello, world'

mylist = string1.split(', ') #output => ['hello', 'world']

myjoin1 = ', '.join(mylist) #output => 'hello, world'
myjoin2 = ' '.join(mylist) #output => 'hello world'
myjoin3 = ','.join(mylist) #output => 'hello,world'
5
# Python program to convert a list to string 
    
# Function to convert   
def listToString(s):  
    
    # initialize an empty string 
    str1 = ""  
    
    # traverse in the string   
    for ele in s:  
        str1 += ele   
    
    # return string   
    return str1  
        
        
# Driver code     
s = ['Geeks', 'for', 'Geeks'] 
print(listToString(s))  
2
a = [1, 2, 3]   
map(str, a)  
['1', '2', '3']
1

New to Communities?

Join the community