根据老男人需求,需要编写登录接口
- 输入用户名密码
- 认证成功以后显示欢迎信息
- 输错三次以后锁定
name = ‘Allen‘
password = 123
i = 0
while i <3
username = input (‘your username:‘)
pwd = int(input(‘your password:‘))
if username == name and password == pwd:
print (‘welcome!!!‘)
break
else:
print(‘wrong username or password,please try again!!!‘)
i += 1
else:
print (‘lock‘)
需要补充:账号密码文件与锁定文件,有待完善
时间: 2024-12-28 03:35:49