FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PythonTutorial/OOPOverride.py at master · BassamPython/PythonTutorial · GitHub
BassamPython
/
PythonTutorial
Public
forked from
hussien89aa/PythonTutorial
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PythonTutorial
/
OOPOverride.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (24 loc) · 606 Bytes
Breadcrumbs
PythonTutorial
/
OOPOverride.py
Copy path
File metadata and controls
32 lines (24 loc) · 606 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
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
Sub
(
self
,
n1
,
n2
):
super
().
Sub
(
n1
,
n2
)
#SubResult=n1-n2+5
#print("Sub=",SubResult)
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
()
Back
|
FazBrowse Home
|
New Git URL