eLearning
Tutorials
Programs
Interview Questions
Technical Questions
C Language
C++
JAVA
HTML & CSS
PHP
AJAX
J2EE
SQL
jQuery
Go back to Home
Our Placements
Tutorials
Programs
Interview Questions
Technical Questions
Live Training
Our Placements
Associated Colleges
Our Recruiters
Back
C Language
C++
JAVA
HTML & CSS
PHP
AJAX
J2EE
SQL
jQuery
Programs
Home
Programs
Python
Method Overloading
Programs - Python -
Method Overloading
Program:
# First product method.
# Takes two argument and print their product
def
product
(a, b)
:
p = a * b
print(p)
# Second product method.
# Takes three argument and print their product
def
product
(a, b, c)
:
p = a * b * c
print(p)
# Uncommenting the below line shows an error, this is because the second function overload the first
# product(4, 5)
# This line will call the second product method
product(
4
,
5
,
5
)
Output:
100