-Inheritance allows us to define a class that inherits all the methods and properties from another class.
Parent class-
it is the class being inherited from, also called base class.
Child class-
Child class is the class that inherits from another class, also called derived class.
Multiple Inheritance-
When a child class inherits the property of more then one parent class then it is said to be multiple inheritance.
Syntax-
class A():
body
class B():
body
class C(A,B):
body
-Here class C is inherits the property of class A and class B.
program-
#create class
class A():
def func1(self):
print("Function of A class")
class B():
def func2(self):
print("Function of B class")
class C(A,B):
def func3(self):
print("Function of C class")
obj=C()
obj.func1()
obj.func2()
obj.func3()
Function of A class
Function of B class
Function of C class