Skills101
← All practice quizzes

Quiz: Inheritance, ABC and MRO

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

Go beyond basic inheritance. Force subclasses to implement methods with abstract base classes, understand multiple inheritance and the MRO, see how super() really works, use mixins, and know when composition is the better design.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What happens when you try to create an object of a class that still has an unimplemented abstract method?

  2. Question 2

    Can an abstract base class contain normal (non-abstract) methods?

  3. Question 3

    What does this print?

    class A:
        def who(self): return "A"
    class B(A):
        def who(self): return "B"
    class C(A):
        def who(self): return "C"
    class D(C, B):
        pass
    print(D().who())
    
  4. Question 4

    What is the MRO?

  5. Question 5

    What does this print?

    class A: pass
    class B(A): pass
    class C(A): pass
    class D(B, C): pass
    print([k.__name__ for k in D.__mro__])
    
🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →