Simple Function Override in Python || Polymorphism || Python

In this we are going to see a program about Simple Function Override in Python Programming Language.


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

    def hello(self):
        print("Hello from Parent")


class Child(Parent):
    def __init__(self):
        print("Child")

    def hello(self):
        print("Hello from Child")


p = Parent()
p.hello()
c = Child()
c.hello()

# Coded By Dhiraj Shelke

#ENJOY CODING

Post a Comment

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

Previous Post Next Post