Answers for "convert each char of string in list in python"

4

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']
Posted by: Guest on May-13-2021

Code answers related to "convert each char of string in list in python"

Python Answers by Framework

Browse Popular Code Answers by Language