the animal class tracks three characteristicsnameageand type production application would probably track more characteristicsbut these characteristics do everything needed for this example the code also includes the required accessors for each of the characteristics the __str__(method completes the picture by printing simple message stating the animal characteristics the chicken class inherits from the animal class notice the use of animal in parentheses after the chicken class name this addition tells python that chicken is kind of animalsomething that will inherit the characteristics of animal notice that the chicken constructor accepts only name and age the user doesn' have to supply type value because you already know that it' chicken this new constructor overrides the animal constructor the three attributes are still in placebut type is supplied directly in the chicken constructor someone might try something funnysuch as setting her chicken up as gorilla with this in mindthe chicken class also overrides the settype(setter if someone tries to change the chicken typethat user gets message rather than the attempted change normallyyou handle this sort of problem by using an exceptionbut the message works better for this example by making the coding technique clearer finallythe chicken class adds new featuremakesound(whenever someone wants to hear the sound chicken makeshe can call makesound(to at least see it printed on the screen testing the class in an application testing the chicken class also tests the animal class to some extent some functionality is differentbut some classes aren' really meant to be used the animal class is simply parent for specific kinds of animalssuch as chicken the following steps demonstrate the chicken class so that you can see how inheritance works this example also appears with the downloadable source code as liststack py open python file window you see an editor in which you can type the example code