-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInheritance
More file actions
33 lines (21 loc) · 720 Bytes
/
Inheritance
File metadata and controls
33 lines (21 loc) · 720 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
n = input("Enter Employee Name 1 :")
class Employee:
def __init__(self,role,dep,sal):
self.role = role
self.dep = dep
self.sal = sal
def show_details(self):
print("Role =", self.role)
print("Department = ",self.dep)
print("Salary = ",self.sal)
class Engineer(Employee):
def __init__(self,dob,age):
self.dob=dob
self.age=age
super().__init__("Engineer","Aws","75,000")
def show_details(self):
super().show_details()
print("DOB = ",self.dob)
print("Age = ",self.age)
e1 = Engineer("11/05/2005",20)
e1.show_details()