Multi-level Inheritance

Medium Advanced Inheritance & MRO
Solve in Playground →

Problem Statement

Create a chain: `Organism` -> `Animal` -> `Mammal`. Each `__init__` should call `super().__init__()` and set an attribute: `is_living = True` in Organism, `can_move = True` in Animal, `has_hair = True` in Mammal. Instantiate `Mammal` and print the three attributes separated by spaces.

Input Format

None

Output Format

Print the three boolean attributes.

Constraints

None

Sample Output

True True True

Explanation

Multi-level inheritance passes traits sequentially down a linear hierarchy.

Starter Code

class Organism:
    def __init__(self):
        self.is_living = True

class Animal(Organism):
    # Override __init__, call super, and set can_move
    pass

class Mammal(Animal):
    # Override __init__, call super, and set has_hair
    pass

if __name__ == '__main__':
    # Instantiate Mammal and print the attributes
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used