Python Class Inheritance || Ancestor || Single Inheritance || Python
In this we are going to see a basic program to get ancestor by single inheritance in Python Programming Language.



class Ancestor():
    def __init__(self):
        print("Ancestor Class")

    def getAncestor(self,ancestor):
        print("Ancestor Is : ", ancestor)

class Decendant(Ancestor):
    def __init__(self):
        print("Decendant Class")

d = Decendant()
d.getAncestor("HFC")

# 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