forked from hussien89aa/PythonTutorial
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPOverride.py
More file actions
Latest commit
32 lines (24 loc) · 606 Bytes
/
Copy pathOOPOverride.py
File metadata and controls
32 lines (24 loc) · 606 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
classOperation:
defSum(self,n1,n2):
SumResult=n1+n2
print("Sum=",SumResult)
defSub(self,n1,n2):
SubResult=n1-n2
print("Sub=",SubResult)
classOperationWithMul(Operation):
defMul(self,n1,n2):
MulResult=n1*n2
print("Mul=",MulResult)
defSub(self,n1,n2):
super().Sub(n1,n2)
#SubResult=n1-n2+5
#print("Sub=",SubResult)
defmain():
#OP=Operation()
#OP.Sub(4,2)
#OP.Sum(10,15)
OpMul=OperationWithMul();
OpMul.Sub(4,2)
OpMul.Sum(10,15)
OpMul.Mul(10,2)
if__name__=='__main__':main()