split word into individual letter python code example
Example 1: python split sentence into words
sentence = 'Hello world a b c'
split_sentence = sentence.split(' ')
print(split_sentence)
Example 2: python split word into letter pairs
s = 'abcdef'
L = zip(s[::2], s[1::2])
# -> [('a', 'b'), ('c', 'd'), ('e', 'f')]