Python Polymorphism Questions and Answers
Practice ModeShowing 10 of 25 questions
Q21
What is method chaining in Python?
Answer: Option B
Explanation: Method chaining allows calling multiple methods sequentially on the same object.
Q22
Which concept is closely related to polymorphism?
Answer: Option B
Explanation: Inheritance enables polymorphism by allowing subclasses to override methods from parent classes.
Q23
What is the purpose of the @classmethod decorator?
Answer: Option B
Explanation: @classmethod defines a method that receives the class as the first argument instead of the instance.
Q24
Which method is used for object destruction?
Answer: Option B
Explanation: The __del__ method is called when an object is about to be destroyed.
Q25
What is multiple inheritance in Python?
Answer: Option B
Explanation: Multiple inheritance allows a class to inherit from more than one parent class.