I am making a choose your own adventure game and I have a function to check if what you input in the console is acceptable or not. In the beginning, you can only type "turn on light" if you type anything else it will return as an error and you will be prompted to type an actual action. The problem I have is after you type something that isn't accepted it will not let you continue after you make an error.
actions = ['help','turn light on',]
def errorcheck(player_input):
if player_input in actions:
error = False
return()
else:
error = True
while error == True:
print('i dont know what you mean by',player_input)
player_input = input('>')
if player_input in actions:
error = False
else:
error = True
print('welcome to TITLE')
print('type help at anytime to see your options')
print('">" that symbol promts you to do something')
print('')
print('you wake up, its dark')
player_input = input('>')
errorcheck(player_input)
if error == False:
if player_input == ('help'):
playerhelp = True
while playerhelp == True:
print('you can: turn light on')
playerhelp = False