title: using class to calculate average of a list of entry in python
body: <p>I have to use the class method in python to calculate the average age, height, and weight of a list of 2 school classes and compare them.</p>
  <p>In order to calculate the average ages, I used the following code:</p>
  <pre><code>from statistics import mean
  
  class Student():
      counter = 0
      def __init__ (self, age, height, weight):
          Student.counter += 1
          self.age = age
          self.height = height
          self.weight = weight
  
  class Class_a(Student):
  
      def av_a():
          temp = []
          for i in range (n):
              temp.append(class_a[i].age)
          m_a = (mean(temp))
          return  m_a
  
  
  class_a = []
  
  n = 2 
  age_a = ['15', '99'] 
  height_a = ['123', '144'] 
  weight_a = ['33', '28']
  
  for i in range (n):
      class_a.append(Class_a(float(age_a[i]), float(height_a[i]), float(weight_a[i])))
  
  
  print(Class_a.av_a())
  </code></pre>
  <p>It would be highly appreciated if anyone reviews the code and let me know the best way to do such a calculation.</p>
  <p>Thank you in advance.</p>