亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

變量說它沒有定義,但它是

變量說它沒有定義,但它是

慕田峪7331174 2022-06-28 16:46:13
錯誤信息:Traceback (most recent call last):  File "C:/Users/ADMIN/Desktop/python/footballcomplex.py", line 85, in <module>    if input2 == 'a':NameError: name 'input2' is not defined這是第 83-85 行:input2 = input("Would you like to long pass to 3(a) or through ball to 2(b)")if input2 == 'a':如果您想立即閱讀全文:link to codehttps://pastebin.com/bhYMKa8M問題在于當我將 b 或 c 用于第一個 a、b 和 c 問題時。但 A 工作得非常好。請幫助我真的不知道。Python 3.7 版
查看完整描述

2 回答

?
牧羊人nacy

TA貢獻1862條經驗 獲得超7個贊

刪除之前的縮進line83



查看完整回答
反對 回復 2022-06-28
?
蕭十郎

TA貢獻1815條經驗 獲得超13個贊

83號線,

input2 = input("Would you like to long pass to 3(a) or through ball to 2(b)")

在它之前的 if 語句中。

if input1 == 'a':

現在它只在 input1=='a' 時要求輸入,但是如果你去掉那個縮進,它會要求輸入而不管 input1


查看完整回答
反對 回復 2022-06-28
  • 2 回答
  • 0 關注
  • 119 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號