Use of super() Python to Access both Constructor and Methods of Base Class - 1 || Constructor Inheritance || Python

In this we are going to see a program on Use of super() Python to Access both Constructor and Methods of Base Class - 1 in Python Programming Language.

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

    def BaseFunc(self):
        print("Base Function")


class Child(Base):
    def __init__(self):
        super().BaseFunc()
        super().__init__()
        print("Child")

    def ChildFunc(self):
        print("Child Function")


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