-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhierarchical.py
More file actions
49 lines (32 loc) · 726 Bytes
/
Copy pathhierarchical.py
File metadata and controls
49 lines (32 loc) · 726 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
37
38
39
40
41
42
43
44
45
46
47
48
49
class Ceo:
def role(self):
print("I am ceo")
def organization(self):
print("AD")
class Cto(Ceo):
def role(self):
print("i am cto")
def Tech_department(self):
print("Techinical")
class Cfo(Ceo):
def role(self):
print("i am cfo")
def Finance_department(self):
print("Financial")
class Dev(Cto):
def role(self):
print("i am developer")
class Cashier(Cfo):
def role(self):
print("i am Cashier")
d = Dev()
d.role()
d.Tech_department()
c = Cashier()
c.role()
c.Finance_department()
c.organization()
d.organization()
# c cant call Tech_department()
# d cant call Finance_department()
# MRO : method resolution order