jjzjj

PriceList

全部标签

python - 类型错误 : 'float' object is not subscriptable

PizzaChange=float(input("Whatwouldyoulikethenewpriceforallstandardpizzastobe?"))PriceList[0][1][2][3][4][5][6]=[PizzaChange]PriceList[7][8][9][10][11]=[PizzaChange+3]基本上我有一个输入,用户将输入一个数字值(浮点输入),然后它将所有上述列表索引设置为该值。出于某种原因,我无法在不提出以下建议的情况下设置它们:TypeError:'float'objectisnotsubscriptable错误。是我做错了什么,还是我的看法