In [3]:
secret = "rhubarb"
attempts = 0
while True:
password = input("Enter Password: ")
attempts= attempts + 1
if password == secret:
print("Access Granted!")
break
print("Invalid password attempt #",attempts)
if attempts == 5:
print("You are locked out")
break
In [ ]:
In [ ]: