Is the Bat a Mammal or a Bird?
You have been given a task to create a Python program that will demonstrate the concept of multiple inheritance and class hierarchy. The program should include four classes:
Animal: This is a general class that represents any animal. It has one method:is_animal(), which printsThis is an animal.Mammal: This is a specific class that represents mammals and inherits from theAnimalclass. It has an additional method:is_mammal(), which printsThis is a mammal.Bird: This class represents birds and also inherits from theAnimalclass. It has an additional method:is_bird(), which printsThis is a bird.Bat: This class represents a bat, a unique creature that is both a mammal and a bird due to its ability to fly. This class inherits from bothMammalandBirdclasses.
Input | Output |
|---|---|
| This is an animal |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB