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:
  1. Animal: This is a general class that represents any animal. It has one method: is_animal(), which prints This is an animal.
  1. Mammal: This is a specific class that represents mammals and inherits from the Animal class. It has an additional method: is_mammal(), which prints This is a mammal.
  1. Bird: This class represents birds and also inherits from the Animal class. It has an additional method: is_bird(), which prints This is a bird.
  1. 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 both Mammal and Bird classes.
Input
Output
bat = Bat(); bat.is_animal(); bat.is_mammal(); bat.is_bird();
This is an animal This is a mammal This is a bird
 

Constraints

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