0 votes
in Python by
Does multiple inheritances is supported in Python?

1 Answer

0 votes
by
Multiple inheritance is supported in python. It is a process that provides flexibility to inherit multiple base classes in a child class.

Example of multiple inheritance in Python is as follows:

class Calculus:  

def Sum(self,a,b):  

return a+b;  

class Calculus1:  

def Mul(self,a,b):  

return a*b;  

class Derived(Calculus,Calculus1):  

def Div(self,a,b):  

return a/b;  

d = Derived()  

print(d.Sum(10,30))  

print(d.Mul(10,30))  

print(d.Div(10,30))

Output:

1

2

3

40

300

0.3333

Related questions

+1 vote
asked Jan 20, 2022 in UnrealScript by rajeshsharma
0 votes
asked Sep 21, 2021 in Python by sharadyadav1986
...