mercredi 8 septembre 2021

How do I make my if statement actually do something

def attempt_function():
    number_of_attempts = 1
    saidpassword = ""
    if number_of_attempts > 3:
        print("You have entered the wrong password too many times, please try again later")
    saidpassword = input("the password you entered is incorrect, please try again\n")
    if saidpassword != password:
        number_of_attempts + 1
        saidpassword = input("the password you entered is incorrect, please try again\n")

the if number_of_attempts > 3: doesn't seem to work when I use all of my attempts. It basically doesn't print.

Aucun commentaire:

Enregistrer un commentaire