Commit c77317a5 by BellCodeEditor

save project

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