book' examples doesfile person-department py aggregate embedded objects into composite class personsame class manager(person)same class departmentdef __init__(self*args)self members list(argsdef addmember(selfperson)self members append(persondef giveraises(selfpercent)for person in self membersperson giveraise(percentdef showall(self)for person in self membersprint(personif __name__ ='__main__'bob person('bob smith'sue person('sue jones'job='dev'pay= tom manager('tom jones' development department(bobsuedevelopment addmember(tomdevelopment giveraises development showall(embed objects in composite runs embedded objectsgiveraise runs embedded objects__repr__ when runthe department' showall method lists all of its contained objects after updating their state in true polymorphic fashion with giveraises[personbob smith [personsue jones [persontom jones interestinglythis code uses both inheritance and composition--department is composite that embeds and controls other objects to aggregatebut the embedded person and manager objects themselves use inheritance to customize as another examplea gui might similarly use inheritance to customize the behavior or appearance of labels and buttonsbut also composition to build up larger packages of embedded widgetssuch as input formscalculatorsand text editors the class structure to use depends on the objects you are trying to model--in factthe ability to model real-world entities this way is one of oop' strengths design issues like composition are explored in so we'll postpone further investigations for now but againin terms of the basic mechanics of oop in pythonour person and manager classes already tell the entire story now that you've mastered more realistic example