# 實現用戶輸入用戶名和密碼,當用戶名為seven或者Alex且密碼為123時,顯示登錄成功,否則失敗,失敗時允許重復輸入三次。
count = 0
while count < 3:
username = input("Please enter your username: ")
password = input("Please enter your password: ")
if username == "seven" and password == "123":
print("%s login successful." %username)
break
elif username == "alex" and password == "123":
print("%s login successful." %username)
break
else:
print("login failed.")
count += 1
if count == 3:
print("the max input is 3 times. ")