-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.py
More file actions
28 lines (22 loc) · 771 Bytes
/
Employee.py
File metadata and controls
28 lines (22 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)
#create object of class
emp1 = Employee("Zara",2000)
emp2 = Employee("Munni",5000)
emp1.displayEmployee()
emp2.displayEmployee()
print ("Total Employee %d" %Employee.empCount)
#print ("employee._doc_:",Employee._doc_)
#print ("employee._name_:",Employee._name_)
#print ("employee._module_:",Employee._module_)
#print ("Employee._bases_:",Employee._bases_)
#print ("Employee._dict_:",Employee._dict_)