猿问

python 出错 'int' object is not iterable大佬们有什么好的建议?

t=0W=[2,2,2,3,3,3,5,5,5,5,8,8]UW=[2,3,5,8]Tfit=[12,24,25]forjinrange(len(UW)):
t=t+sum(W.count(UW[j])*max(Tfit)/len(W))
错误提示:Traceback(mostrecentcalllast):File"C:/Users/zb/Desktop/compute.py",line6,in
t=t+sum(W.count(UW[j])*max(Tfit)/len(W))
TypeError:'float'objectisnotiterable去掉“/len(W)”时,显示:TypeError:'int'objectisnotiterable
蛊毒传说
浏览 383回答 2
2回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答