class base#statement class derived (base)#statement class derived (derived )#statement herederived is derived from baseand derived is derived from derived so finally all the features of base class and derived class are present in derived class exampleclass fishdef community(self)print(" am inside fish class"class mammal(fish)def protect_mammal(self)print(" am inside mammal class "class goldfish(mammal)def protect_gf(self)print(" am inside goldfish class "obj=goldfish(obj community()obj protect_mammal(obj protect_gf(outputi am inside fish class am inside mammal class am inside goldfish class data encapsulation encapsulation hides the implementation details of class from other objects the aim of using encapsulation is that the data inside the object should only be accessed through public interface if we want to use the data stored in an object to perform an action or calculate derived valuewe define method associated with the object which does this page