1 count = 0 2 while count < 3: 3 user = input("输入用户名:") 4 pwd = input("输入密码") 5 if user == 'alex' and pwd =='123': 6 print("欢迎登陆") 7 break 8 else: 9 print("用户名或密码错误") 10 count = count + 1