python string to list of words 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 convert a string to a list of words
>>> "Please split this string".split()
['Please', 'split', 'this', 'string']