In this we are going to see a basic program on family tree with hybrid inheritance type 2 in Python Programming Language.
class gparent:
def func4(self):
print("Hello Grandparent")
class parent1(gparent):
def func1(self):
print("Hello Parent 1")
class parent2(gparent):
def func2(self):
print("Hello Parent 2")
class child(parent1,parent2):
def func3(self):
print("Hello Child")
test = child()
test.func4()
test.func1()
test.func2()
test.func3()
# Coded by Saahil
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP