Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 Tsukuba Japan April 2010 Proceedings Part 1 Lncs 5981

Authors: Hiroyuki Kitagawa ,Yoshiharu Ishikawa ,Wenjie Li ,Chiemi Watanabe

2010th Edition

3642120253, 978-3642120251

More Books

Students also viewed these Databases questions