attemptsRemaining = 5
if attemptsRemaining == 0:
print("Entry failed. Locking program.")
exit()
while attemptsRemaining > 0:
passwordEntry = input("Enter the password to access the data: ")
if passwordEntry == 1234:
print("test")
else:
attemptsRemaining -1
So, I'm using Python to write a simple password script, but the program doesn't stop looping the "enter the password" input even after I get it right, and when I get it wrong five times it still loops. Does anybody know how I can troubleshoot this issue?
Thanks.