In this program, we will take a string as input and convert a string into a list of words.
Steps to solve the program
- Take a string as input.
- Convert the string into a list of words using split().
- Print the output.
#Input string
string = "learning python is fun"
list1 = string.split(" ")
#Printing output
print(list1)
Output :
['learning', 'python', 'is', 'fun']