-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject47.py
110 lines (70 loc) · 1.39 KB
/
project47.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#inheritence
class A:
def feature1(self):
print("Feature1 working")
def feature2(self):
print("Feature2 working")
class B(A):
def feature3(self):
print("Feature3 working")
def feature4(self):
print("Feature4 working")
class C(B):
def feature5(self):
print("Feature5 working")
def feature6(self):
print("Feature6 working")
print("For a1:")
a1 = A()
a1.feature1()
a1.feature2()
print()
print("For b1:")
b1 = B()
b1.feature1()
b1.feature2()
b1.feature3()
b1.feature4()
print()
print("For c1:")
c1 = C()
c1.feature1()
c1.feature2()
c1.feature3()
c1.feature4()
c1.feature5()
c1.feature6()
print()
class A:
def feature1(self):
print("Feature1 working")
def feature2(self):
print("Feature2 working")
class B:
def feature3(self):
print("Feature3 working")
def feature4(self):
print("Feature4 working")
class C(A,B):
def feature5(self):
print("Feature5 working")
def feature6(self):
print("Feature6 working")
print("For a1:")
a1 = A()
a1.feature1()
a1.feature2()
print()
print("For b1:")
b1 = B()
b1.feature3()
b1.feature4()
print()
print("For c1:")
c1 = C()
c1.feature1()
c1.feature2()
c1.feature3()
c1.feature4()
c1.feature5()
c1.feature6()