Question: PYTHON TURTLE GRAPHICS Create four functions to draw four basic shapes on the canvas using Turtle Graphics. There will be one function for each shape.
PYTHON TURTLE GRAPHICS
Create four functions to draw four basic shapes on the canvas using Turtle Graphics. There will be one function for each shape. Each function will take as arguments the position where the center of the basic shape will be when drawn ((x,y) coordinates on the canvas), the color of the lines to draw the shape, and the size of the shape. These functions are:
(a) rectangle (x, y, color, width, height)
(b) square (x, y, color, side). This function will call rectangle passing the argument side as the width and the length.
(c) eq_triangle (x,y,color,side). An equilateral triangle.
(d) circle5(x,y,color,radius). For this function the built-in TG circle function may be used. But the circle5 function has to handle the position in which the circle will be placed, its color, and its size.
2. Create a function using the four functions described above (point 1) to draw a jacko-lantern. The name of the function is jack_o_lantern.
Im not asking for the whole code, if someone could define at least one shape and explain how to put them all in one function that would be great because I have absolutely no idea how to do that, thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
