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]’.
A name string and an integer age separated by space.
Print the initialized attributes.
None
Alice 10
Name: Alice, Age: 10
The super() function allows a derived class to invoke its base class's methods, including the constructor.
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
passEmbedded 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