Commit 6551169d by BellCodeEditor

save project

parent b810c294
Showing with 26 additions and 0 deletions
i=3
while True:
username = "python"
userpassword = "123456"
name = input('请输入用户账号:')
password = input('请输入用户密码:')
if i>0:
if name == username and password == userpassword:
print(' 登陆成功! ')
print('欢迎来到贝尔编程!')
break
elif name == username:
print(' 用户密码输入错误\n 请重新输入')
i-=1
print(f'您还有{i}次机会')
elif password == userpassword:
print(' 用户账号输入错误\n 请重新输入')
i-=1
print(f'您还有{i}次机会')
else:
print(' 用户账号和用户密码都输入错误\n 请重新输入')
i-=1
print(f'您还有{i}次机会')
if i==0:
exit()
\ 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