The Work of a Biologist

You are an ambitious biologist who is studying animal behavior and needs a way to catalog the various activities of different species. To help with this, you have decided to write a Python program that represents animals and their behaviors.
In this task, you are asked to create a parent class Animal with methods eat() and sleep(). Each of these methods should return an appropriate message when called:
  • eat() should return the message "Animal is eating..."
  • sleep() should return the message "Animal is sleeping..."
The program should also include two child classes that inherit from the Animal class: Bird and Fish. These classes should inherit the sleep() method from the Animal class, but they should also include unique methods to represent their own unique behaviors.
In the Bird class, override the eat() method to return the message "Bird is pecking at its food...". Additionally, include a method fly() that returns the message "Bird is flying...".
In the Fish class, include a method swim() that returns the message "Fish is swimming...".
bird = Bird(); fish = Fish(); print( + '\n' + bird.sleep() + '\n' + + '\n' + + '\n' + fish.sleep() + '\n' + fish.swim())
Bird is pecking at its food... Animal is sleeping... Bird is flying... Animal is eating... Animal is sleeping... Fish is swimming…


Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue