title: How make a summ of 2 attributes in a class
body: <p>I am trying to learn more about classes and objects in Python and the following is an example given in a tutorial. In the below code I am using:</p>
  
  <pre><code>class Employee(object):
      'common base clase for all employee'
      empCount = 0
  
      def __init__(self, name, surname, pay):
          self.name = name
          self.surname = surname
          self.pay = pay
          Employee.empCount += 1
  
      def displayCount(self):
          print('Total employee {}'.format(Employee.empCount))
  
      def displayEmployee(self):
          print('Name: ', self.name, ', Surname: ', self.surname, ', Pay: ', self.pay)
  
      def summPay(self):
          pass
  </code></pre>
  
  <p>I have passed to that class 2 objects, <code>emp1</code> and <code>emp2</code></p>
  
  <pre><code>emp1 = Employee('Federico', 'Olivieri', '5000')
  emp2 = Employee('Anonymous', 'Friend', '6500')
  </code></pre>
  
  <p>What I want is to create another method <code>summPay</code> under the <code>Employee</code> class to make the sum of all salary. I know I could try to use a local variable and increment the variable as for <code>empCount</code> but I was wondering if there is a more elegant way to do it. </p>