so for my problem, I have to create a program that takes a users input, and then prints it like a list. For example, if the user inputs "I like doing this activity, the program should return it as.
I
like
doing
this
activity.
But these should work with any scenario that the user inputs.
I tried using the input function and split to try and define the variables
my_list_of_data = input("Enter your sentence:").split()
print("(%s),/n(%s),/n(%s),/n(%s),/n(%s)"%(my_list_of_data))
I am getting an error in line 2, saying there is not enough arguments to create a string.
my_list_of_datawhen you get this error?print("\n".join(my_list_of_data))?%s;%formatting special-cases tuples, so tryprint("(%s),/n(%s),/n(%s),/n(%s),/n(%s)"%tuple(my_list_of_data)). But now you have the problem of extra parentheses and/nnot being a newline...\n.