How do I split a sentence and store each word in a list? For example, given a string like "these are words"
, how do I get a list like ["these", "are", "words"]
?
To split on other delimiters, see Split a string by a delimiter in python.
To split into individual characters, see How do I split a string into a list of characters?.
print(word)
as your last line.