← 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?
- A.By writing several methods with the same name
- B.Python supports overloading like Java
- C.With default arguments or *args in one method
- 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 →