In this we are going to see a basic example of multiple inheritance in Python Programming Language.
class parent1: # parent class
def func1(self):
print("Hello Parent 1")
class parent2: # parent class
def func2(self):
print("Hello Parent 2")
class child(parent1,parent2): # child class
def func3(self): # we include the parent class
print("Hello Child") # as an argument in the child
# class
# Driver Code
test = child()
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