Coding task · Python course · Module 3: Object-Oriented Programming

Property Setter

Create a setter with @property.setter

Task

Add a setter (@age.setter) to the age property that changes the age but rejects negative numbers (raises ValueError)