list of string to string python code example
Example 1: list to string python
List = ["ITEM1", "ITEM2", "ITEM3"]
string_version = "".join(List)
print(string_version)
Example 2: python list to string
mystring = 'hello, world'
mylist = string1.split(', ')
myjoin1 = ', '.join(mylist)
myjoin2 = ' '.join(mylist)
myjoin3 = ','.join(mylist)
Example 3: python convert list to list of strings
lsit_of_strings = [str(i) for i in your_list]
your_list = ['strings', 'and', 'numbers', 11, 23, 42]
lsit_of_strings = [str(i) for i in your_list]
print(lsit_of_strings)
--> ['strings', 'and', 'numbers', '11', '23', '42']
Example 4: concatenate list of strings python
listvalues = ['a', 'b', 'c']
concstring = ''.join(l)