Home Tutorials Python OOP Concepts Multilevel Inheritance
Multilevel Inheritance

Multilevel Inheritance


15. Multilevel Inheritance

Multilevel inheritance happens when a class inherits from another child class in a chain. This creates a parent-child-grandchild relationship.

Syntax

class C(B):
    pass

Example

class Grandparent:
    def house(self):
        print("Grandparent House")

class Parent(Grandparent):
    pass

class Child(Parent):
    pass

obj = Child()
obj.house()

Output

Grandparent House
Example

🏋️ Test Yourself With Exercises

Take our quiz on Multilevel Inheritance to test your knowledge.

Browse Quizzes »