Question
The following programs use the turtle module; 1. Write a program to draw five squares in random locations in the window; make each square a
The following programs use the turtle module;
1. Write a program to draw five squares in random locations in the window; make each square a different color. Use a loop to draw each square
2. complete the following code to use a turtle to draw a series of concentric circles. write the body of the loop that draws the circles.
import turtle
wn = turtle.Screen()
jane = turtle.Turtle() for r in range(10, 50, 10): #Add your code here to draw a bullseye pass #This statement does nothing
wn.exitonclick()
3. complete the following code to use a turtle to draw a rectangle with vertical lines at every 10 pixels. The given code draws the initial rectangle. add code that draws vertical lines at a distance of 10 apart; use a loop.
import turtle
wn = turtle.Screen() jane = turtle.Turtle() jane.up() jane.goto(-200, -50) jane.down() for distance in [400, 100, 400, 100]: jane.forward(distance) jane.left(90)
#Add your code here
wn.exitonclick()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started