Commit 44c2b274 by BellCodeEditor

save project

parent 627052a8
Showing with 7 additions and 2 deletions
...@@ -4,7 +4,7 @@ while True: ...@@ -4,7 +4,7 @@ while True:
userpassword = "123456" userpassword = "123456"
name = input('请输入用户账号:') name = input('请输入用户账号:')
password = input('请输入用户密码:') password = input('请输入用户密码:')
if i>0: if i>1:
if name == username and password == userpassword: if name == username and password == userpassword:
print(' 登陆成功! ') print(' 登陆成功! ')
print('欢迎来到贝尔编程!') print('欢迎来到贝尔编程!')
...@@ -12,11 +12,15 @@ while True: ...@@ -12,11 +12,15 @@ while True:
elif name == username: elif name == username:
print(' 用户密码输入错误\n 请重新输入') print(' 用户密码输入错误\n 请重新输入')
i=i-1 i=i-1
print(f'您还有{i}次机会')
elif password == userpassword: elif password == userpassword:
print(' 用户账号输入错误\n 请重新输入') print(' 用户账号输入错误\n 请重新输入')
i=i-1 i=i-1
print(f'您还有{i}次机会')
else: else:
print(' 用户账号和用户密码都输入错误\n 请重新输入') print(' 用户账号和用户密码都输入错误\n 请重新输入')
i=i-1 i=i-1
elif i==0: print(f'您还有{i}次机会')
elif i==1:
print('您的帐号已经被锁定')
exit() 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