forked from hussien89aa/PythonTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPInhertance.py
More file actions
28 lines (20 loc) · 494 Bytes
/
OOPInhertance.py
File metadata and controls
28 lines (20 loc) · 494 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
class Operation:
def Sum(self,n1,n2):
SumResult=n1+n2
print("Sum=",SumResult)
def Sub(self,n1,n2):
SubResult=n1-n2
print("Sub=",SubResult)
class OperationWithMul(Operation):
def Mul(self,n1,n2):
MulResult=n1*n2
print("Mul=",MulResult)
def main():
#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()