-
Inheritance
-
The super method
-
Class attributes
-
Class methods
-
Make the
Dog
class inherit fromMammal
(be sure to import!) -
Amend the
__init__
method for Dog so it properly utilizes thesuper
method. -
Amend the
__repr__
method so it makes sense with the new attributes fromMammal
. -
Change the behavior for the
make_sound
method inDog
so it returns something that makes more sense. You will not need to usesuper
. -
Change the
sleep
andrun_around
methods forDog
so that they use thesuper
keyword. Add additional dog-centric behavior to the methods (for example print or return something new that gives us an idea of what theDog
instance is doing).
-
Give the
Fish
a class attributeall_fish
which starts as an empty list. -
When a new
Fish
is created, append it toFish.all_fish
. -
Create a new class method
num_fish
which returns the length ofFish.all_fish
. -
Create a class method
all_fish_names
which returns a list of all the names forFish
instances. HINT: You can use list comprehension for this! -
Create a class method
average_length
which returns the average length in inches for allFish
instances. HINT: The average is the sum of lengths / number of fish. There are several ways of getting the average in Python...