-
Notifications
You must be signed in to change notification settings - Fork 0
/
46_super.py
45 lines (32 loc) · 989 Bytes
/
46_super.py
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
37
38
39
40
41
42
43
44
45
class Person:
country = "India"
def __init__(self):
print("Initializing Person...\n")
def takeBreath(self):
print("I am breathing...")
class Employee(Person):
company = "Honda"
def __init__(self):
super().__init__()
print("Initializing Employee...\n")
def getSalary(self):
print(f"Salary is {self.salary}")
def takeBreath(self):
super().takeBreath()
print("I am an Employee so I am luckily breathing..")
class Programmer(Employee):
company = "Fiverr"
def __init__(self):
# super().__init__()
print("Initializing Programmer...\n")
def getSalary(self):
print(f"No salary to programmers")
def takeBreath(self):
super().takeBreath()
print("I am a Progarmmer so I am breathing++..")
# p = Person()
# p.takeBreath()
# e = Employee()
# e.takeBreath()
pr = Programmer()
# pr.takeBreath()