实例目的:熟悉while循环与if循环
#仿用户登录
_username="郭杰"
_password="guojie521125"
i=1#:输入的次数;当输入的次数大于3时,提示请找回密码
while i<=4:
if i==4:
print("请找回您的密码!")
name = input("name:")
password = input("password:")
if _username==name and _password==password:
print("欢迎%s登陆"%_username)
break;
else:
print("您的账号或密码不对")
i=i+1
转载于:https://www.cnblogs.com/guojie-guojie/p/8337452.html