Create a Python class called Circle
in a file called circle.py
that represents a two dimensional circle. Give the class methods that do the following:
In a separate file, create code that tests each of the methods of the circle class.
Modify the Circle
class so that when the circle is initialized it also draws a circle at the appropriate location of and appropriate size using turtle graphics. To draw the circle use the shape method to change the appearance of the turtle to a circle. Resize the turtle to the appropriate size using the shapesize method. Note, that the stretch_wid
and stretch_len
arguments are the factor by which to stretch the turtle’s shape. A factor of 1 will leave the turtle at its orginal size, which is 20 pixels.
Add methods to the Circle
class that change the location and radius of the circle. When the location or size of the circle is changed the drawing of the circle should be updated to reflect the change.