#!/usr/bin/env python
# Robin
# 作业二:编写登陆接口
# 输入用户名密码
# 认证成功后显示欢迎信息
# 输错三次后锁定
username = "robin"
password = "12345"
confirm_the_lock=""
time = 0
while time != 3:
input_username = input("username:")
input_password = input("password:")
if input_username == username and input_password == password:
print("Login Success!")
break
else:
time += 1
if time == 3:
confirm_the_lock = "Your account has been locked!"
error = '''
error:
passwordWrong(There are {residue_degree} chances left)
{lock}
'''.format(residue_degree=3 - time,lock=confirm_the_lock)
print(error)