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
Splits the string in text on any consecutive runs of whitespace.
text
words = text.split()
Split the string in text on delimiter: ",".
","
words = text.split(",")
The words variable will be a list and contain the words from text split on the delimiter.
list