Bird
0
0

What is the main purpose of a parent class in Python?

easy📝 Conceptual Q11 of 15
Python - Inheritance and Code Reuse
What is the main purpose of a parent class in Python?
ATo hold common features that child classes can inherit
BTo override methods in child classes
CTo create instances directly without child classes
DTo prevent child classes from adding new features
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of parent class

    A parent class is designed to hold common features like methods and attributes that multiple child classes can share.
  2. Step 2: Compare options with this role

    To hold common features that child classes can inherit correctly states this purpose. Other options describe incorrect or unrelated roles.
  3. Final Answer:

    To hold common features that child classes can inherit -> Option A
  4. Quick Check:

    Parent class = common features [OK]
Quick Trick: Parent class shares features for children to reuse [OK]
Common Mistakes:
  • Thinking parent classes prevent changes in children
  • Believing parent classes are only for direct instances
  • Confusing overriding with inheritance

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes