username = "Anker" passward = "Abc123" number =2 for i in range(1,4,1): _username = input("username:") _passward = input("passward:") if _username==us ...
username = "Anker" passward = "Abc123" number =2 for i in range(1,4,1): _username = input("username:") _passward = input("passward:") if _username==username and _passward==passward: print("登錄成功") break else: print("username or passward wrong,please input again.remain :",number) number = number - 1 else: print("輸入三次錯誤,已鎖定")View Code