char list to string python code example
Example 1: python string to list of chars
l = list('abcd') # ['a', 'b', 'c', 'd']
l = map(None, 'abcd') # ['a', 'b', 'c', 'd']
l = [i for i in 'abcd'] # ['a', 'b', 'c', 'd']
import re # importing regular expression module
l = re.findall('.', 'abcd')
print(l) # ['a', 'b', 'c', 'd']
Example 2: python character list to string
string_holder = ""
string_list = ( "h", "e", "l", "l" ,"o" )
string_holder.join(string_list)
print(string_holder)
#output
# hello