Commit 6cdff079 by BellCodeEditor

save project

parent 08f2cdeb
Showing with 6 additions and 4 deletions
...@@ -2,21 +2,23 @@ i=5 ...@@ -2,21 +2,23 @@ i=5
username = "钟离" # 保存在服务器数据库中的用户账号(正确的账号) username = "钟离" # 保存在服务器数据库中的用户账号(正确的账号)
userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码) userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码)
while True: while True:
if i>0: #if i==0:
name=input("请输入用户账号") name=input("请输入用户账号")
# 请用input()实现用户输入账号、密码的功能 # 请用input()实现用户输入账号、密码的功能
password=input("请输入账号密码") password=input("请输入账号密码")
i-=1 i-=1
if username!=name: if username!=name:
print("用户名不正确") print("用户名不正确")
print("温馨提示你还有"+str(i)+"次机会")
continue continue
if userpassword!=password: if userpassword!=password:
print("账号密码不正确") print("账号密码不正确")
if passusername==name and userpassword==password: print("温馨提示你还有"+str(i)+"次机会")
if username==name and userpassword==password:
print("登录成功") print("登录成功")
break break
else: # else:
print("jhu") print("账号已锁定")
exit() exit()
......
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