I want my Python function to split a sentence (input) and store each word in a list. My current code splits the sentence, but does not store the words as a list. How do I do
If you want all the chars of a word/sentence in a list, do this:
print(list("word")) # ['w', 'o', 'r', 'd'] print(list("some sentence")) # ['s', 'o', 'm', 'e', ' ', 's', 'e', 'n', 't', 'e', 'n', 'c', 'e']