Commit 0a38b6ae by BellCodeEditor

save project

parent b4f212e4
Showing with 23 additions and 12 deletions
i=3
userneme = "python" username = "python"
userpassword = "123456" userpassword = "123456"
while True: while True:
usersname=input("请输入账号:") if i>0:
if usersname != username: usersname=input("请输入账号:")
print("账号错误,请重新输入") if username != usersname:
continue print("账号错误,请重新输入")
userspassword=input("请输入密码:") continue
if usersname==username and userspassword==userpassword: userspassword=input("请输入密码:")
print("登陆成功") if usersname==username and userspassword==userpassword:
break print("登陆成功")
break
else:
print("密码错误,请重新输入")
i-=1
else: else:
print("密码错误,请重新输入") 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