-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops.py
More file actions
36 lines (22 loc) · 771 Bytes
/
Copy pathoops.py
File metadata and controls
36 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
29
30
31
32
33
34
35
36
class Employee(object):
def __init__(self,name,salary):
self.name= name
self.salary=salary
def details(self):
#print('My name is {}\t'.format(self.name))
print("and his salary is {} per month".format(self.salary))
class alex(Employee):
def details(self):
print("The salary of {} is {} per month".format(self.name,self.salary)) #polymorphishm
class alen(Employee): #inheritance
def __init__(self, name, salary, company):
self.company = company
Employee.__init__(self,name,salary)
def identify(self):
print("{} is the employee in {}".format(self.name,self.company))
#obj instant
a=alen("Alen",20000,"XYZ")
a.identify()
a.details()
b=alex("Alex",15000)
b.details()