0

I am making a game where you are lost in the forest, i made a function where it will ask a user for a number of what to do. I want to make it where if the number is not in the list it will make them enter it again and say what they entered is an invalid number. Instead it just shows up with invalid number and then it will stay there until enter is pressed. This is the code that i tried:

def askbear1():
print('WHAT DO YOU DO!')
print('1. See if I can find the bear')
print('2. Just ignore it')
print('3. Gather Materials to protect yourself')
bear1 = input('\nChoice: ')
time.sleep(1.5)
if bear1 == '1':
    input('You chose to try to find the bear')
elif bear1 == '2':
    input('You chose to ignore it')
elif bear1 == '3':
    input('You chose to gather materials to protect yourself')
else:
    input('Please enter a valid number')
    askbear1()
blvuxe
  • 21

0 Answers0