Extending Base Class Methods

Medium Single Inheritance Fundamentals
Solve in Playground →

Problem Statement

Define a `Parent` class with a `display()` method printing ‘Parent Display’. Define a `Child` class that overrides `display()` to first call `super().display()` and then print ‘Child Display’. Instantiate `Child` and call `display()`.

Input Format

None

Output Format

Print the messages on separate lines.

Constraints

None

Sample Output

Parent Display
Child Display

Explanation

Overriding a method but retaining the base functionality is a common pattern to extend class behavior.

Starter Code

class Parent:
    def display(self):
        print('Parent Display')

class Child(Parent):
    def display(self):
        # Call base display then print 'Child Display'
        pass

if __name__ == '__main__':
    c = Child()
    # Call display
    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