Parameterized super Constructor in Inheritance Constructor in Python – 2 || Constructor Inheritance || Python

In this we are going to see a program about Parameterized super Constructor in Inheritance Constructor in Python – 2 in Python Programming Language.

class Product:

    def __init__(self):
        print("Base Constructor")

    def product(self, a, b):
        a = 5
        b = 7
        print(a*b)


class baseProduct(Product):

    def __init__(self):
        print("Child Constructor")
        super().product(3, 8)

    def product(self, a, b):
        print(a*b)


p = baseProduct()
p.product(3, 8)

# 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