QuestionQ37

VerifiedObject-Oriented Programming

Assuming the following inheritance hierarchy is in effect, which classes are declared correctly?

Question Image

Choose two
Explanation

Python cannot create a consistent method-resolution order when a class lists a superclass before one of that superclass’s subclasses. A class can inherit from D directly, and it can inherit from the sibling classes C and B because their shared base A can be ordered after both.

Community Discussion

No comments yet. Be the first to start the discussion!