Commit 18062003 by BellCodeEditor

save project

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