Valid person
Input
Person('Alice', 30).is_valid()
Output
True
Name is a non-empty string and age is an integer within [0, 120].
Full lesson preview
Create a class that validates its constructor arguments and provides a simple is_valid method.
Problem statement
Task
Examples
Input
Person('Alice', 30).is_valid()
Output
True
Name is a non-empty string and age is an integer within [0, 120].
Input format
Output format
Constraints
Samples
Input
Person('Bob', 0).is_valid()
Output
True
Age 0 is allowed (lower bound).