samedi 12 janvier 2019

Why is the code not working as intended? Its intended to get input and then do true/false checks up to 3 times

Creating nested conditional statements but when i run this and the first boolean is false, the next input prompt doesn't come up, please help

bird_names="magpie pigeon dove"
bird_guess=input("venture a guess about the bird names we have stored: ")
if bird_guess in bird_names==False:
    bird_guess=input("venture a guess about the bird names we have stored: ")
    if bird_guess in bird_names==False:
        bird_guess=input("try again ")
        if bird_guess in bird_names==False:
            print("you're out of tries")
        else:
            print("third time lucky")
    else:
        print("second time lucky")
else:
    print("first time lucky")

Aucun commentaire:

Enregistrer un commentaire