Question: Q 1 . Create a Circle class in Python that stores the radius of a circle and includes getter and setter methods to modify it
Q Create a Circle class in Python that stores the radius of a circle and includes getter and setter methods to modify it using the property decorator. Also, add a method named area to calculate the area of the circle.
The radius of the circle should be greater than zero. When attempting to set the radius to a value less than or equal to zero, print the message "Radius must be greater than zero." 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
