The super() Function Initialization

Medium Single Inheritance Fundamentals
Solve in Playground →

Problem Statement

Create a `Parent` class whose `__init__` takes `name`. Create a `Child` class whose `__init__` takes `name` and `age`. Use `super().__init__(name)` to set the name, and set the age locally. Read inputs and print ‘Name: [name], Age: [age]’.

Input Format

A name string and an integer age separated by space.

Output Format

Print the initialized attributes.

Constraints

None

Sample Input

Alice 10

Sample Output

Name: Alice, Age: 10

Explanation

The super() function allows a derived class to invoke its base class's methods, including the constructor.

Starter Code

class Parent:
    def __init__(self, name):
        self.name = name

class Child(Parent):
    def __init__(self, name, age):
        # Use super() to initialize name, and set age locally
        pass

if __name__ == '__main__':
    n, a = input().split()
    # Instantiate Child and print
    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