UrbanPro

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Can I do method overloading in Python classes?

Asked by Last Modified  

2 Answers

Learn Python

Follow 2
Answer

Please enter your answer

Web developer with more than 4 years of experience.

No python does not support method overloading. If you try to define a new function the older function will be replaced. Method overloading can be done under special cases such as inheritance.
Comments

Like other languages (for example, method overloading in C++) do, python does not support method overloading by default. But there are different ways to achieve method overloading in Python. The problem with method overloading in Python is that we may overload the methods but can only use the latest...
read more

Like other languages (for example, method overloading in C++) do, python does not support method overloading by default. But there are different ways to achieve method overloading in Python.

The problem with method overloading in Python is that we may overload the methods but can only use the latest defined method.

# 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
# product(4, 5)

# This line will call the second product method
product(4, 5, 5)


Output: 100

read less
Comments

Related Questions

I want full details of the Python training, topics covered timing and duration. How much Fee for full course?
We conduct hands-on Python workshop at Kochi with personal attention to each participant. Classes with a batch of l1 or 2 students are also conducted based on the convenience of learner and tutor. Workshop...
Ravi
How to remove matching elements from two nested lists while iterating
for i in list_1: for j in list_2: if i==j: list_1.remove(i) list_2.remove(j)
Lalitha

Who can learn the Python?

Anyone can learn python doesn't require any programming knowledge (or) experience. Python is much easier as compared to other programming languages. Python is easy to learn. The learning curve is very gradual.
Sunil

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Big Data & Hadoop - Introductory Session - Data Science for Everyone
Data Science for Everyone An introductory video lesson on Big Data, the need, necessity, evolution and contributing factors. This is presented by Skill Sigma as part of the "Data Science for Everyone" series.

Datetime Module
#this examples demonstrate use of datetime module import datetimeob=datetime.datetime.now()print("-"*25)print(ob)print(ob.year)print(ob.month)print(ob.day)print(ob.hour)print(ob.minute)print(ob.second)str1=str(ob.hour)+':'+str(ob.minute)+':'+str(ob.second)print...

Write your first Python program in 10 minutes
1. Download python from python official site search "python download" in google 2. Install in your machine 3. verify using : "python --version" command 4. Write first program using notepad create...

What is a generator?
A generator is a function that has one or more yield statements. Example: >>>def gen_demo(a): yield a a = a+10 yield a a = a+30 yield a >>>gen_a...

Using the Math Library in Python
Using the Math Library in Python. Python provides many useful mathematical functions in a special math library. A library is a module that contains some useful definitions. We now consider...

Recommended Articles

Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for Python Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more