I am learning the basics of programming using Python and I am trying to compare a variable to another. Here's what I have:
code = "03"
count = 0
npw=str(input("Enter code: "))
while count != 2:
    if npw == code:
        print("Success")
        break
    else:
        print("incorrect")
        npw=str(input("Enter code: "))
        count += 1
print("Reached Maximum Tries")
I want the user to have 3 tries to guess the code, but upon trying 3 tries, the third one was not read. Also, when I entered the correct code, it also prints the "Reached Maximum Tries". Thanks in Advance.
 
    