show wrong time

This commit is contained in:
kouhe
2022-03-26 12:51:33 +08:00
parent e955e6df6c
commit d93deb5950

View File

@@ -20,6 +20,8 @@ while True:
else: else:
print("Wrong password!") print("Wrong password!")
wrong_time += 1 wrong_time += 1
# print you had wrong password wrong_time times, max 3 times
print("You had wrong password %d times, max 3 times" % wrong_time)
if wrong_time == 3: if wrong_time == 3:
print("Too many wrong password!") print("Too many wrong password!")
exit() exit()