obj= (instance of child obj display(child class overriden method outputthis is base class this is derived class composition classesin composition we do not inherit from the base class but establish relationship between classes through the use of instance variables that are references to other objects composition means that an object knows another object and explicitly delegates some tasks to it while inheritance is implicitcomposition is explicit in python we use composition when we want to use some aspects of another class without promising all of the features of that other class syntaxclass genericclassdefine some attributes and methods