Bird
0
0

Which keyword is required to call the parent class method from an overridden method in Python?

easy📝 Conceptual Q2 of 15
Python - Inheritance and Code Reuse

Which keyword is required to call the parent class method from an overridden method in Python?

Asuper()
Bparent()
Cbase()
Dself()
Step-by-Step Solution
Solution:
  1. Step 1: Recall how to access parent methods

    Python uses super() to refer to the parent class inside child methods.
  2. Step 2: Using super() in overridden methods

    Calling super().method() runs the parent class's version of the method.
  3. Final Answer:

    super() -> Option A
  4. Quick Check:

    Call parent method = super() [OK]
Quick Trick: Use super() to access parent methods inside child [OK]
Common Mistakes:
  • Using incorrect keywords like parent()
  • Trying to call self() instead of super()
  • Forgetting to use parentheses with super

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes