-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinheretance.py
More file actions
51 lines (39 loc) · 806 Bytes
/
inheretance.py
File metadata and controls
51 lines (39 loc) · 806 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
50
51
class A:
def feature1(self):
print("1 is working")
def feature2(self):
print("2 is working")
class B(A):
def feature3(self):
print("3 is working")
def feature4(self):
print("4 is working")
call = A()
call.feature1()
call.feature2()
call2 = B()
call2.feature3()
class C(B):
def feature1(self):
print("6 is working")
call3 = C()
call3.feature4()
class G:
def featurea(self):
print("1 is working")
def featureb(self):
print("2 is working")
callG = G()
callG.featurea()
class E:
def featurel(self):
print("3 is working")
def featurem(self):
print("4 is working")
callE = E()
callE.featurem()
class F(E, G):
def feature1(self):
print("6 is working")
callF = F()
callF.feature1()