In this we are going to see a program on simple example of inheritance in Python Programming Language.
class PParent():
def PFunc(self):
print('Paternal function')
class MParent():
def MFunc(self):
print('Maternal function')
class Child(PParent, MParent):
def CFunc(self):
print('Child function')
class Gchild(Child):
def GFunc(self):
print('Grandchild function')
ob = Gchild()
ob.GFunc()
ob.CFunc()
ob.PFunc()
ob.MFunc()
# Coded by Saahil
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP