我需要计算列表中一系列对象的质量
for element in list:
weight = "a calculation here"
我如何保存权重计算并在每次经过for循环时将其相加?
for element in list:
weight += "a calculation here"
这个对你有用吗?