How do I skip lines or go back to lines in a loop.
Making a video game. One portion is attack and one portion is run. If they input "attack" I can get the program to use an if statement to say a weapon (knife). But how can I get it to stop after run (for input "run" I only want one option)? I tried adding "continue", etc. but it didnt seem to work. Any help appreciated. print("What will you do? Run or attack?") x = input() if x == ("attack"): print("You attack. How do you attack?") elif x == ("run"): print("You run. Should stop here.") y = input() while True: if x == ("attack"): print("You will attack ") if y == ("knife"): print("with a knife") break