Python Multiple Inheritance Constructor - 1 || Constructor Inheritance || Python

In this we are going to see a basic program on Python Multiple Inheritance Constructor - 1 in Python Programming Language.

class Base1:
    def __init__(self):
        self.a = 10
        print(self.a)


class Base2:
    def __init__(self):
        self.a = 11
        print(self.a)


class Child(Base1, Base2):
    def __init__(self):
        super().__init__()
        self.a = 12
        print(self.a)


c = Child()

# Coded by Saahil

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post