Commit 861ed1c3 by BellCodeEditor

save project

parent 8aa8d5b0
Showing with 7 additions and 1 deletions
username = "4" # 保存在服务器数据库中的用户账号(正确的账号) username = "4" # 保存在服务器数据库中的用户账号(正确的账号)
userpassword = "8" # 保存在服务器数据库中的用户密码(正确的密码) userpassword = "8" # 保存在服务器数据库中的用户密码(正确的密码)
c=3
# 请用input()实现用户输入登陆登陆成功、密码的功能 # 请用input()实现用户输入登陆登陆成功、密码的功能
while True: while True:
if c>0
name=input("输入账号") name=input("输入账号")
password=input("输入密码") password=input("输入密码")
c-1
if username==name and userpassword == password: if username==name and userpassword == password:
print("登陆成功") print("登陆成功")
break break
...@@ -13,5 +15,8 @@ while True: ...@@ -13,5 +15,8 @@ while True:
continue continue
if userpassword != password: if userpassword != password:
print("密码错误") 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