I need to compute the mass of a series of objects in a list
for element in list:
weight = "a calculation here"
How do I save the weight calculation and add it up for each time it goes through the for loop?
I need to compute the mass of a series of objects in a list
for element in list:
weight = "a calculation here"
How do I save the weight calculation and add it up for each time it goes through the for loop?
for element in list:
weight += "a calculation here"
Does this work for you?