Skip to main content
🔮 Output PredictionPY Python Hard⚡+35 XP

Class Inheritance MRO

What does this print?

Python
class A: def greet(self): return "A"
class B(A): pass
class C(A): def greet(self): return "C"
class D(B, C): pass
print(D().greet())

🔮 What is the output?