标签:显示 else while welcome lock use inpu 用户名 and
编写登陆接口
输入用户名密码
认证成功后显示欢迎信息
输错三次后锁定
user = "jean"
pwd = "123456"
count = 0
while count < 3:
count += 1
username = input("username: ")
passworld = input("passworld: ")
if count == 3:
print("Account is locked..")
exit(1)
if username == user and passworld == pwd:
print("Welcome {name} login.".format(name=username))
exit(1)
else:
print("invliad user or password. try again")
标签:显示 else while welcome lock use inpu 用户名 and
原文地址:http://www.cnblogs.com/liuyibai/p/7145928.html