I'm trying to create an object as created below obj1 i.e. inside the Employee class itself. But I'm facing errors in such object creation.
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
obj1 = Employee("Mayank",6000)