Live coding today! We will design and implement classes for various animals ( Animal , Fish , Bird , Penguin , and Parrot ). What is an appropriate hierachy? What class and instance attributes do we need? Can we have default values for some attributes? What methods do we need and which ones should we override?

Lecture Prep

Review: the slides and your notes from the last two lectures so that you're ready to start applying what was discussed.
Read: the slides and the skeleton file below and think about the questions asked. We'll complete the implementation of the classes together in lecture.


Lecture materials

Slides: individual slides for viewing , 6-up layout for printing

Examples:

Do after lecture

Complete the file zoology.py by implementing the subclasses Parrot and Penguin . You can design them as you wish--this is just for practice--but you can use the ideas below if you want to match your code to ours, which is now posted :

After you complete the class definitions, check out this module that sets up a zoo ! The given module creates a Zoo and lets you interact with the animals. You can play a little at the zoo, and then read the code to see how we use Animal and its subclasses.

Link to Lecture Recording