我試圖運行一個腳本,詢問用戶他們最喜歡的運動隊。這是我到目前爲止:用戶輸入的腳本
print("Who is your favorite sports team: Yankees, Knicks, or Jets?")
if input is "Yankees":
print("Good choice, go Yankees")
elif input is "Knicks":
print("Why...? They are terrible")
elif input is "Jets":
print("They are terrible too...")
else:
print("I have never heard of that team, try another team.")
每當我運行這個腳本,最後的「else」函數接管用戶可以輸入任何內容之前。
另外,沒有一個團隊可供選擇。幫幫我?
你有沒有定義的輸入? – tox123 2015-02-12 01:35:13