!3 显示密码错误次数

Merge pull request !3 from kou he/show-wrongtimes
This commit is contained in:
kou he
2022-03-26 05:03:01 +00:00
committed by Gitee

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()