python
i=0
while i<3:
user_name=input("Enter your name:")
pwd=input('Enter your password:')
if user_name=='******' and pwd=='*****':
print('Welcome',user_name,' to the system')
i=8
else:
if i<2:
print('Wrong username or password,you have ',2-i,'chances left')
i+=1
if i==3:
print('You have entered wrong username or password three times,you have been locked')
登录成功的情况:
登录失败的情况: