PizzaChange=float(input("What would you like the new price for all standard pizzas to be? "))
PriceList[0][1][2][3][4][5][6]=[PizzaChange]
PriceList[7][8][9][10][11]=[PizzaChange+3]
基本上我有一個輸入,一個用戶將放置多個值(浮動輸入)進,那麼將所有這些前述的列表索引的設置爲該值。出於某種原因,我不能得到它設置他們沒有拿出一個:類型錯誤:「浮動」對象未標化的
TypeError: 'float' object is not subscriptable
錯誤。我做錯了什麼,或者我只是看錯了方向?
什麼行會產生錯誤? – ASGM