Question: Q 2 . Create a Person class in Python that stores a person's name and age and includes getter and setter methods for both attributes.
Q Create a Person class in Python that stores a person's name and age and includes getter and setter methods for both attributes.
The setter methods should include validation to ensure that the age is a positive integer. If an invalid age is provided ie less than or equal to print the message "Age must be greater than to the screen and do not change the value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
