Commit 1e4514f6 by BellCodeEditor

save project

parent b810c294
Showing with 22 additions and 0 deletions
username = "python"
userpassword = "123456"
user_try = 10
while user_try > 0:
name = input("请输入用户名:")
password = input("请输入密码:")
if name == username and password == userpassword:
print("登录成功!")
break
elif name != username:
print("用户名错误!请重新输入!")
user_try -= 1
print("您的登陆次数仅剩%d次!" % (user_try))
else:
print("密码错误,请重新输入!")
user_try -= 1
print("您的登陆次数仅剩%d次!" % (user_try))
if user_try == 0:
print("您错误的次数过多!您已被系统禁止登陆!")
else:
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