class Employee:
‘Common base class for all employees’
empCount = 0
#The first method __init__() is a special method, which is called class constructor or initialization method that Python calls when you create a new instance of this class.
def __init__(self, name, salary, a):
self.name = name
self.salary = salary
self.age = a
Employee.empCount += 1
def displayCount(self):
print(“Total Employee %d” % Employee.empCount)
def displayEmployee(self):
print(“Name : “, self.name, “, Salary: “, self.salary, “, Age: “, self.age)
def displayName(self):
print(“Name : “, self.name)
def displaySalary(self):
print(“Salary : “, self.salary)
def displayAge(self):
print(“Age : “, self.age)
#This would create first object of Employee class
emp1 = Employee(“Zara”, 2000,23)
emp2 = Employee(“Zara”, 2000,23)
emp1.displayEmployee()
emp1.displayAge()
emp1.displayName()
print (“Total Employee “, Employee.empCount)