Basic usage
Input
p = Person(25) p.age
Output
25
Constructor stores the age via the property. Getter returns the integer age.
Full lesson preview
Create a Person class with an age property that validates and normalizes assignments.
Problem statement
Task
Examples
Input
p = Person(25) p.age
Output
25
Constructor stores the age via the property. Getter returns the integer age.
Input format
Output format
Constraints
Samples
Input
p = Person(29.9) p.age
Output
29
Float is converted to int (truncated) and returned.