My problem is my list(lst) is not storing in the file. WONDERFUL COMMUNITY YOU HAVE. I am new to the site so please be aware of that in the comments. The following is my code I was able to store it long ago but there were problems so I undid it and for some reason, in my head, I CANNOT REMEMBER what I did to store it!
days = ["sunday","monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
answered = False
while answered == False:
userInput = input("What day of the week would you like to assign a event: ")
lst = []
input_words=userInput.lower().split()
for word in input_words:
if word in days:
lst.append(word)
print(word)
# set answered to True boolean
answered = True
print((lst))
# only evaulated after reviewing all words, if True is not set, prompts user again and let's them know that their answer is not valid
if answered == False:
print("You typed days of week wrong! Try Again!")
def listToString():
if 0 < 2:
test = open('hold.txt', 'a')
print(test.write(lst + '\n'))
test.close()
return listToString
'a+' does not work!! in repl.it I have tried many things that would be a waste to mention just really trust me I have a stroke explaining. But when I do put lst into the file i want it to be spaced out on each line so for each item i would like it on a new line but for not just storing 1 item. I am new to this site. Also does any one wanna tell me why my code keeps giving me the output of what appears to be the size of 1 item in a list that I write to my file