count=0 while count<3: username=input("请输入用户名:") password=input("请输入密码:") if(username=="seven" or username=="alex"): print("用户名正确") if(password=="123"): print("登录成功") break else: print("密码错误") count+=1 else: print("用户名和密码错误请重新输入") count+=1
10-02
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)