Create a person and read attributes
Input
Person('Alice', 30).name
Output
Alice
After constructing Person with 'Alice' and 30, the instance attribute name should be 'Alice'.
Full lesson preview
Learn how to initialize instance attributes in a class using the constructor (__init__).
Problem statement
Task
Examples
Input
Person('Alice', 30).name
Output
Alice
After constructing Person with 'Alice' and 30, the instance attribute name should be 'Alice'.
Input format
Output format
Constraints
Samples
Input
Person('Bob', 0).age
Output
0
The age attribute should be set to 0 for this instance.