1# To split the string at every character use the list() function
2word = 'abc'
3L = list(word)
4L
5# Output:
6# ['a', 'b', 'c']
7
8# To split the string at a specific character use the split() function
9word = 'a,b,c'
10L = word.split(',')
11L
12# Output:
13# ['a', 'b', 'c']
1l = list('abcd') # ['a', 'b', 'c', 'd']
2l = map(None, 'abcd') # ['a', 'b', 'c', 'd']
3l = [i for i in 'abcd'] # ['a', 'b', 'c', 'd']
4
5import re # importing regular expression module
6l = re.findall('.', 'abcd')
7print(l) # ['a', 'b', 'c', 'd']
1# Python3 program to Split string into characters
2def split(word):
3 return list(word)
4
5# Driver code
6word = 'geeks'
7print(split(word))
8
9#Output
10['g', 'e', 'e', 'k', 's']