following example demonstrates inheritance in pythonclass shapedef __init__(self)print("shape constructor"def area()print("area of shape"def peri()print("perimeter of shape"class circle(shape)def __init__(selfr)shape __init__(self#calling parent constructor self radius print("circle constructor"def area(self)print("area of circle is:" *self radius*self radiusc circle( area(polymorphism polymorphism means having different forms based on the contexta variablefunctionor an object can have different meaning as inheritance is related to classespolymorphism is related to methods in pythonmethod overriding is one way of implementing polymorphism method overriding in method overridinga base class and the derived class will have method with the same signature the derived class method can provide different functionality when compared to the base class method when derived class method is created and the method is invokedthe derived class method executes overriding the base class method following example demonstrates method overridingclass shapedef __init__(self)print("shape constructor"def area(self)print("area of shape"def peri(self)print("perimeter of shape"class circle(shape)def __init__(selfr)shape __init__(self#calling parent constructor self radius print("circle constructor"def area(self)print("area of circle is:" *self radius*self radiusc circle( area(#circle class area method overrides shape class area method