Given the string
string1='apple purple orange brown'
How would I go about turning it into a list
list1=['apple','purple','orange','brown']
I thought I could do
string1='apple purple orange brown'
list1=[]
for item in string1:
list1.append(item)
But that gives me a list of every single character of the string, not just the words. Would there be a way to split the string up by it's spaces, and then add it to the list?