Commit 0a38b6ae by BellCodeEditor

save project

parent b4f212e4
Showing with 14 additions and 3 deletions
i=3
userneme = "python" username = "python"
userpassword = "123456" userpassword = "123456"
while True: while True:
if i>0:
usersname=input("请输入账号:") usersname=input("请输入账号:")
if usersname != username: if username != usersname:
print("账号错误,请重新输入") print("账号错误,请重新输入")
continue continue
userspassword=input("请输入密码:") userspassword=input("请输入密码:")
...@@ -12,4 +13,8 @@ while True: ...@@ -12,4 +13,8 @@ while True:
break break
else: else:
print("密码错误,请重新输入") print("密码错误,请重新输入")
i-=1
else:
print("错误次数已超出,已冻结。")
exit()
print("欢迎来到贝尔编程!") print("欢迎来到贝尔编程!")
\ No newline at end of file
userneme="python" userneme="python"
userpassword="123456" userpassword="123456"
while True: while True:
...@@ -10,6 +11,9 @@ while True: ...@@ -10,6 +11,9 @@ 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