<Iterating through multiple objects to read proper...
# forum
r
Iterating through multiple objects to read properties I’m very new to programming in general and am trying to figure out how to add up some integers from specific objects. I have a class called Shapes with various objects. Each object has a property about its shape (either square or circle) and a integer with its size. What I’m trying to figure out is how to write a function to add up just the sizes from each shape with a square. Is there a way to iterate through each object in the class to check for the shape and add the size to a variable if...