I'm trying to make a random menu generator by asking the user to input a food and every time they input it I would like it to start a new line in the .txt file but I get a 'string not supported error'
I have already tried taking away the str() before the 'file,"\n"' and I can't really find much to help me on other sites
name = open("food.txt", "a")
file = input("please enter food you like: ")
file = str(file,"\n")
name.write(file)
name.close()
open1 = open("food.txt", "r")
print (open1.read())
I expect it just to create a variable with a new line on the end of it but I get a 'decoding str is not supported' error