Skip to content

Commit 10b573a

Browse files
authored
Implement operator overloading example
Added example of operator overloading in Python.
1 parent 55ea0cc commit 10b573a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Operator Overriding is when a operator performs differently with different types of arguements.
2+
3+
def plus(a, b):
4+
return a+b
5+
6+
print(plus(14, 72)) # Output: 86
7+
print(plus("hacktober" + "fest")) # Output: hacktoberfest

0 commit comments

Comments
 (0)