Commit 6f44c351 by BellCodeEditor

save project

parent 0a38b6ae
Showing with 3 additions and 4 deletions
...@@ -6,6 +6,8 @@ while True: ...@@ -6,6 +6,8 @@ while True:
usersname=input("请输入账号:") usersname=input("请输入账号:")
if username != usersname: if username != usersname:
print("账号错误,请重新输入") print("账号错误,请重新输入")
i-=1
print("温馨提示:您还有"+str(i)+"次机会")
continue continue
userspassword=input("请输入密码:") userspassword=input("请输入密码:")
if usersname==username and userspassword==userpassword: if usersname==username and userspassword==userpassword:
...@@ -14,6 +16,7 @@ while True: ...@@ -14,6 +16,7 @@ while True:
else: else:
print("密码错误,请重新输入") print("密码错误,请重新输入")
i-=1 i-=1
print("温馨提示:您还有"+str(i)+"次机会")
else: else:
print("错误次数已超出,已冻结。") print("错误次数已超出,已冻结。")
exit() exit()
......
...@@ -11,9 +11,6 @@ while True: ...@@ -11,9 +11,6 @@ while True:
userspassword=input("请输入密码:") userspassword=input("请输入密码:")
if userspassword != userpassword: if userspassword != userpassword:
print("密码错误,请重新输入") print("密码错误,请重新输入")
i-=1
else:
else: else:
break break
print("登陆成功,欢迎来到python世界!") print("登陆成功,欢迎来到python世界!")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment