Steve
0
Q:

python string to char array

def split(word): 
    return [char for char in word]  
      
# Driver code 
word = 'geeks'
print(split(word)) 

#Output ['g', 'e', 'e', 'k', 's']
10
>>> s = "foobar"
>>> list(s)
['f', 'o', 'o', 'b', 'a', 'r']
1
# Python3 program to Split string into characters 
def split(word): 
    return list(word) 
      
# Driver code 
word = 'geeks'
print(split(word)) 
0

New to Communities?

Join the community