编写一个登陆接口:
账户密码输入
认证成功后显示欢迎信息
输错3次后锁定
_username = 101645 _password = 101645 for i in range(100): username = int(input("username:")) password = int(input("password:")) if username == _username and password == _password: print("Wlcome to system") break if username != _username and password != _password: print("The users and password is error") if i == 2: print("the system is locking") break
原文地址:http://13717089481.blog.51cto.com/13168879/1958198