What this Python inheritance question tests
This is an easy Python language-knowledge question designed to assess your understanding of how class inheritance and method resolution work in Python. It requires you to trace through a code snippet and predict its output—a foundational skill for catching bugs and understanding object-oriented code behaviour.
To solve it, you need to be comfortable with Python's method-resolution order (MRO), how parent and child classes interact, and what happens when methods are called on instances. The question rewards careful reading of the code and systematic reasoning about which methods get invoked at each step.
- Class inheritance and the inheritance hierarchy
- Method overriding and name resolution
- Instance vs. class behaviour