samedi 16 octobre 2021

Why the if-else statement is not giving me the right prompt, even when I put the right information in?

I am trying to do some questions through what-if statements in phyton. Basically, depending on what you answer you should get the next question

match_flashlight = input("You are walking through a dark forest and find two items: a MATCH and a FLASHLIGHT. Which one do you want to pick up?")

if match_flashlight.lower() == "match":
   run_hide = input("You pick up the match and strike it, and for an instant, the forest around you is illuminated. You see a large grizzly bear, and then the match burns out. Do you want to RUN, or HIDE behind a tree?")  

else: 
    print("You put an invalid answer")

Now, if I enter match, it should give the question that is inside the variable called run_hide, but it is just giving me the printing the else statement. Can someone explain to me why this is happening?

Aucun commentaire:

Enregistrer un commentaire