Question: Circle class. 1. Modify the Circle class given in 3 ways: (a), (b) & (c). (a) - implement __str__ and __repr__ methods exactly as shown
Circle class. 1. Modify the Circle class given in 3 ways: (a), (b) & (c). (a) - implement __str__ and __repr__ methods exactly as shown below.
(b) - make the radius a property and add an attribute radius_log that is a list containing radius values that have belonged to the circle, where the last item in the list is the value of the current radius. In other words, I want you to keep a log of the changes to the radius of the circle object. Each time the radius changes, add the new value to the list.
______________________________________________________________________________________________________________________________________________
EXAMPLE CODE TO MODIFY: for (a) & (b)

________________________________________________________________________________________________________
EXAMPLE CODE FOR (c)
(c) Once you have completed parts (a) and (b), modify the Circle class so that it will raise a ValueError if the radius or diameter is set to less than zero. All of the REPL commands from (a) and (b) should still work!

_________________________________________________________________________________
Update:

>>> circle = Circle() Circle (radius=1) Traceback (most recent call last) from HW5 import Circle circle circle.radius1 File "stdins", line 1, in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
