Commit 8edc3026 by BellCodeEditor

save project

parent 4ce966e1
Showing with 21 additions and 0 deletions
i=3 #定义"i",表示输入次数
username = "python" #设置账号
userpassword = "123456" #设置密码
while True:
if i>0:
name = input("请输入用户名:") #用户输入
password = input("请输入密码:") #用户输入
i-=1 #输入次数减少1
if name == username and password == userpassword: #判断用户名与密码是否正确
print("登录成功!")
break #跳出循环
if name != username: #判断用户名是否错误
print("用户名不存在,请重新输入")
continue #跳出本次循环
if password != userpassword: #判断密码是否错误
print("密码错误,请重新输入")
else:
print("你的账户已被锁定,请带身份证来我司解锁")
exit() #终止程序
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