🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Polymorphism: all 10 questions

Quiz: Polymorphism · Question 9 of 10

How does Python usually replace method overloading by parameter count?

How does Python usually replace method overloading by parameter count?

  1. A.By writing several methods with the same name
  2. B.Python supports overloading like Java
  3. C.With default arguments or *args in one method
  4. D.With the @overload decorator only
Answer & explanation

Correct answer: With default arguments or *args in one method

A later def with the same name simply replaces the earlier one in Python.

Can you get the rest right without peeking?

Take the timed Quiz: Polymorphism quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →