Python Multiple Inheritance Constructor - 2 || Constructor Inheritance || Python

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

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


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


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


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