1

Im making a game for a hobby, sort of an adventure text based game. I cant figure out how id make it so if they type anything other than "Get up", the process repeats and the code asks them again repeatedly until they get the right answer.

getup = input("What is your action?: ")
if getup == "Get Up":
    print("You stand up and get your bearings. You scan the enviroment. There is a small passage way to the north, and tight crevis to the east. Everywhere else is just cave wall")
elif getup == "get up":
    print("You stand up and get your bearings. You scan the enviroment. There is a small passage way to the north, and tight crevis to the east. Everywhere else is just cave wall")
elif getup == "Get up":
    print("You stand up and get your bearings. You scan the enviroment. There is a small passage way to the north, and tight crevis to the east. Everywhere else is just cave wall")
elif getup == "GET UP":
    print("You stand up and get your bearings. You scan the enviroment. There is a small passage way to the north, and tight crevis to the east. Everywhere else is just cave wall")
else:
    print("Celsia: You do not have time to waste,",name,"!!. You must Get Up")
U13-Forward
  • 69,221
  • 14
  • 89
  • 114

1 Answers1

2

Maybe using while loop:

getup = input("What is your action?: ")
while getup.lower()!='get up':
    print("Celsia: You do not have time to waste,",name,"!!. You must Get Up")
    getup = input("What is your action?: ")
print("You stand up and get your bearings. You scan the enviroment. There is a small passage way to the north, and tight crevis to the east. Everywhere else is just cave wall")
U13-Forward
  • 69,221
  • 14
  • 89
  • 114