calling __init__ function python code example

Example 1: python calling method from constructor

class TheBestClass:
  def __init__(self, num1, num2)
    self.number1 = num1
    self.number2 = num2
    self.AddTogether()   #call it within self.
    
  def AddTogether(self):
    print(self.number1 + self.number2)

Example 2: def __init__

#!/usr/bin/python

class Employee:
   'Common base class for all employees'
   empCount = 0

   def __init__(self, name, salary):
      self.name = name
      self.salary = salary
      Employee.empCount += 1
   
   def displayCount(self):
     print "Total Employee %d" % Employee.empCount

   def displayEmployee(self):
      print "Name : ", self.name,  ", Salary: ", self.salary

"This would create first object of Employee class"
emp1 = Employee("Zara", 2000)
"This would create second object of Employee class"
emp2 = Employee("Manni", 5000)
emp1.displayEmployee()
emp2.displayEmployee()
print "Total Employee %d" % Employee.empCount