Question: Write a function called move_to(pos) that moves the turtle to the position pos with the pen up and then puts the pen down so

  1. Write a function called move_to(pos) that moves the turtle to the position 

Write a function called move_to(pos) that moves the turtle to the position pos with the pen up and then puts the pen down so that it is ready to draw. pos should be a list (or tuple) with two items (x and y positions). Include the condition that if an empty position list is passed ([]), the turtle position remains unchanged. Call your function with pos= [100,100] to demonstrate that it works. Define a function called draw_square(L, pos) that starts drawing at pos with L being the length of one side of the square. Give pos a default value of 0. You should use the move_to() function you wrote for part a to position the turtle. Call your function after the definition with L=50 and without a pos argument to make sure it works as anticipated. Write another function called draw_polygon(P, pos) that takes in a list of parameters P=[N.L], and draws a polygon with N sides of L length starting at position pos. Give pos a default value of [].Call your function to demonstrate that it works as anticipated. Make a function called draw_circle(r, pos) that draws a circle with radius r starting at position pos. You can use the draw_polygon() function to actually do the drawing. To get the radius right, you just want L to be 2z/N using an N that is large enough so that you can't see the facets (but not so large that it is slow). Give pos a default value of []. Call your function to demonstrate that it works as anticipated. Make a function called draw_flower(shape, N, P, pos). This function should draw the inputted shape N times around a circle, with P being the parameters needed to run shape and pos as the position of the center of the flower. The input shape will be one of the functions you have already written! Call your function to demonstrate that it works as anticipated. An example for a flower with 25 pentagon petals is shown below. When you are successful, include a screenshot in the markdown cell below your code. You probably will want to clear your screen using t.clear(). Make a function called draw_spiral) that draws a spiral with details of your choosing.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

A def movetopos if pos x y pos tpenup tgotoxy tpendown moveto100100 B def drawsquareL pos if pos mov... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!