I have created 12 people with age, gender, height, and weight with OOP class, however, I don't understand how I can make it that it picks specific stuff that I want from the available classes. for example
class Person:
def __init__(self, age, gender, height, weight):
self.height = height
self.weight = weight
self.age = age
self.gender = gender
person1 = Person(19, "Female", 162, 63)
print(person1.weight)
person2 = Person(23, "Male", 170, 89)
print(person2.weight)
person3 = Person(34, "Male", 178, 88)
print(person3.weight)
person4 = Person(44, "Female", 169, 66)
print(person4.weight)
person5 = Person(23, "Female", 166, 64)
print(person5.weight)
person6 = Person(25, "Male", 180, 78)
print(person6.weight)
person7 = Person(18, "Female", 174, 70)
print(person7.weight)
person8 = Person(23, "Male", 190, 90)
print(person8.weight)
person9 = Person(34, "Female", 177, 72)
print(person9.weight)
person10 = Person(27, "Male", 187, 85)
print(person10.weight)
person11 = Person(22, "Male", 184, 80)
print(person11.weight)
person12 = Person(41, "Female", 158, 69)
print(person12.weight)
I want to find the average weight of males in this category, I just don't understand how I can make the code to choose specifically from males and only to average their weight, I added the height and age just for like creating a real environment but these numbers are not important since I only want to find the males weight that's all.