Commit ea3fffe2 by BellCodeEditor

save project

parent f2be331c
Showing with 17 additions and 13 deletions
...@@ -2,16 +2,21 @@ username = "python" # 靽摨葉韐血嚗迤蝖桃 ...@@ -2,16 +2,21 @@ username = "python" # 靽摨葉韐血嚗迤蝖桃
userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码) userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码)
# 请用input()实现用户输入账号、密码的功能 # 请用input()实现用户输入账号、密码的功能
while True: i=3
name = input("请输入用户名:") while True:
password = input("请输入密码:") if i>0:
if name == username and password == userpassword: name = input("请输入用户名:")
print("你已成功登录!") password = input("请输入密码:")
break i-=1
if name != username: if name == username and password == userpassword:
print("你输入的用户名错误请重新输入!") print("你已成功登录!")
continue break
if password != userpassword: if name != username:
print("你输入的密码错误请重新输入!") print("你输入的用户名错误请重新输入!")
continue
if password != userpassword:
print("你输入的密码错误请重新输入!")
else:
print("你的账号已锁定,请来我司解锁!")
exit()
print("欢迎来到贝尔编程!") print("欢迎来到贝尔编程!")
\ 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