Home Tutorials Python OOP Concepts Multiple Inheritance
Multiple Inheritance

Multiple Inheritance


14. Multiple Inheritance

Multiple inheritance allows a class to inherit from more than one parent class. Python supports this directly in the class definition.

Syntax

class C(A, B):
    pass

Example

class Father:
    def skill1(self):
        print("Driving")

class Mother:
    def skill2(self):
        print("Cooking")

class Child(Father, Mother):
    pass

c = Child()
c.skill1()
c.skill2()

Output

Driving
Cooking
Example

🏋️ Test Yourself With Exercises

Take our quiz on Multiple Inheritance to test your knowledge.

Browse Quizzes »