mercredi 2 novembre 2016

Python else if statement

Does anyone know what is wrong with my else if statement?

passcode = 2419

question = raw_input("type code ")

if int(question) == passcode:
    print "yey"
    print "do you want to reset your password? y/n"
    answer = raw_input ("")

    if answer == "y":
        print "ok let do it then!"
        print "type a 4 didget number"
        passcode = raw_input ("Enter here ")
        print (passcode)
    else:
        print "brilliant, have a good day!"




else:
    print "incorrect password"
    print "do you want to reset the password? y/n"
    reset = raw_input("")

    if reset == "y":
        print "ok let do it then!"
        print "type a 4 didget number"
        passcode = raw_input ("Enter here ")
        print (passcode)
    else if reset == "n":
        print "try again and remember it next time!"
    else:
        print "sorry i dont know what you where trying to do there!"

Aucun commentaire:

Enregistrer un commentaire