<s>[INST] Split string into a list in Python I want my python function to split a sentence (input) and store each word in a list. The code that I've written so far splits the sentence, but does not store the words as a list. How do I do that?
def split_line(text):

    # split the text
    words = text.split()

    # for each word in the line:
    for word in words:

        # print the word
        print(word)

 [/INST] Splits the string in text on delimiter: " ".
words = text.split()      

Split the string in text on delimiter: ",".
words = text.split(",")   

The words variable will be a list datatype and contain a list of words from text split on the delimiter.
 </s>