Basic example
Input
Person('Alice', 30, 'NY').summary()
Output
Alice (30) from NY
Creates a Person with name 'Alice', age 30, city 'NY' and returns the formatted summary.
Full lesson preview
Create a simple class and implement a method that returns a human-readable summary of an object's attributes.
Problem statement
Task
Examples
Input
Person('Alice', 30, 'NY').summary()
Output
Alice (30) from NY
Creates a Person with name 'Alice', age 30, city 'NY' and returns the formatted summary.
Input format
Output format
Constraints
Samples
Input
Person('Bob', 0, 'London').summary()
Output
Bob (0) from London
Age can be zero.