Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to split a string by character in python

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

#Output ['g', 'e', 'e', 'k', 's']
 
PREVIOUS NEXT
Tagged: #split #string #character #python
ADD COMMENT
Topic
Name
7+1 =