Im new to python and taking a class. Below's my code. My problem is at the very last line I want it so that if someone simply presses enter it will count as if someone made an input other than (1/2/3 or 4) which would basically reply with the last elif and restart the question. But at the moment it gives me this:
SyntaxError: unexpected EOF while parsing.
Can anyone help?
def menu_loop():
ans = True
while ans:
print("""
1. My freedom awaits me, give me my blade!
2. I've never fought before, might you help me?
3. I have already forsaken freedom, I will fight till the death.
4. Fighting is for the wicked. I refuse to fight.
Press enter to quit
""")
ans= input("What would you like to do now?")
if ans == 1:
main_loop()
break
elif ans == 2:
instructions_loop()
break
elif ans == 3:
gauntlet_loop()
break
elif ans == 4:
print("\nMen... come relieve this man of his life.")
time.sleep(2)
end_game_loop()
break
elif ans == '':
print("\nDo you not speak Latin, slave?")
Thank you, I found the answer thanks to Christian. I guess the site I got instructions from was on Python 3 and I'm on 2 (it's for a university assignment). It's working now, thanks lots!