用戶登錄(三次機會)count = 0 while count < 3: user = input('請輸入帳號:') pwd = input('請輸入密碼:') if user == 'admin' and pwd == '123456': print("登錄成功") break else: print("帳號或密碼錯誤,請從新輸入") count = count + 1