← All topics
Quiz: Inheritance, ABC and MRO: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What happens when you try to create an object of a class that still has an unimplemented abstract method?
- Q2. Can an abstract base class contain normal (non-abstract) methods?
- Q3. What does this print? (code)
- Q4. What is the MRO?
- Q5. What does this print? (code)
- Q6. Inside a method of class B, what does super() refer to when the object is a D (with MRO D, B, C, A)?
- Q7. Why should classes in a diamond call super().method() instead of A.method(self)?
- Q8. What is a mixin?
- Q9. A Library has many Books. Which design fits best?
- Q10. What does this print? (code)