convert string to list of characters python code example
Example 1: how to split a string by character in python
def split(word):
return [char for char in word]
word = 'geeks'
print(split(word))
Example 2: convert string to list python
word = 'abc'
L = list(word)
L
word = 'a,b,c'
L = word.split(',')
L
Example 3: turn a string into a list of characters python
word = list(word)
Example 4: python string to list of letters
def split(word):
return list(word)
word = 'geeks'
print(split(word))
['g', 'e', 'e', 'k', 's']