因此,我正在學習python以獲得樂趣,並且遇到了一個完全困擾我的錯誤。當我運行我的代碼,我得到了以下錯誤:隨機更改類型或可變的Python中間件
TypeError: unsupported operand type(s) for /: 'int' and 'type'
此錯誤是由該司觸發:
for i in items:
print i[1]
multiplier = WeightLeft/i[1]
有我很困惑的事情是,當我打印我[1 ]它打印
<type 'int>
我試圖迫使分母通過把INT是一個int(I [1])作爲分母,但我得到一個新的錯誤:
TypeError: descriptor '__trunc__' of 'int' object needs an argument
任何建議有人可以給予將不勝感激。
您應該在問題中添加更多缺少的代碼。沒有足夠的上下文。 – Apalala 2011-03-16 17:57:08