QuestionQ80

VerifiedObject-Oriented Programming

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

Question Image

Choose two
Explanation

Python multiple inheritance requires a consistent C3 method-resolution order. B and C are sibling subclasses of A, so either sibling may be listed first, while A must remain after both. Listing A before B or C conflicts with the requirement that a subclass precede its superclass, making those declarations invalid.

Learn more

Community Discussion

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