# 实现用户输入用户名和密码,当用户名为seven且密码为123时,显示登录成功,否则失败,失败时允许重复输入三次。count = 0while count < 3: username = input("Please enter your username: ") password = input("Please enter your password: ")if username == "seven" and password == "123":print("login successful.")break else:print("login failed.") count += 1if count == 3:print("the max input is 3 times. ")
转载于:https://www.cnblogs.com/demilyc/p/9975744.html