Following is an example how this particular problem could be solved. However, it will not address problem which is created by 'What would you like to do' part in 'hunt'.
answers = {'heal': 'Your health is restored!',
'hunt': 'You encountered a slime! What would you like to do?'}
def validate(question, allowed=answers):
while True:
answer = input(question)
if answer not in allowed:
print(f"Answer must be one of: {', '.join(allowed)}")
else:
return answer
print(answers[validate("What would you like to do? ")])
EDIT: with Python 3.8 one can shorten function with walrus operator:
def validate(question, allowed=answers):
while (answer := input(question)) not in allowed:
print(f"Answer must be one of: {', '.join(allowed)}")
return answer