Commit 18062003 by BellCodeEditor

save project

parent 888d9d86
Showing with 18 additions and 9 deletions
...@@ -2,16 +2,25 @@ username = "python" # 保存在服务器数据库中的用户账号(正确 ...@@ -2,16 +2,25 @@ username = "python" # 保存在服务器数据库中的用户账号(正确
userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码) userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码)
# 请用input()实现用户输入账号、密码的功能 # 请用input()实现用户输入账号、密码的功能
i=3
while True: while True:
user_name=input("请输入账号") if i>0:
user_password=input("请输入密码") user_name=input("请输入账号")
if user_name==username and user_password==userpassword: user_password=input("请输入密码")
print("登陆成功") i=i-1
break if user_name==username and user_password==userpassword:
if username!=user_name: print("登陆成功")
print("用户名不存在") break
if userpassword!=user_password: if username!=user_name:
print("密码错误!") print("用户名不存在")
print("提示:还剩"+str(i)+"次机会")
continue
if userpassword!=user_password:
print("密码错误!")
print("提示:还剩"+str(i)+"次机会")
else:
print("账户已锁定")
exit()
print("欢迎来到贝尔编程") print("欢迎来到贝尔编程")
......
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