Question: The function has one parameter, a Turtle. After the function definition, call the function 7 times, preferably in a loop. import turtle import random

The function has one parameter, a Turtle. After the function definition, call

 

The function has one parameter, a Turtle. After the function definition, call the function 7 times, preferably in a loop. import turtle import random wn = turtle.Screen() t = turtle.Turtle() x = random.randrange(-120, 140) y = random.randrange(-120, 140) side1 = random.randint(50, 100) side2 = random.randint(50, 100) t.penup() t.goto(x, y) t.pendown() t.goto(x + side1, y) t.goto(x + side1, y + side2) t.goto(x, y) t.goto(x + side1, y+ side2) t.hideturtle() wn.exitonclick()

Step by Step Solution

3.38 Rating (167 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import turtle import random Define a function that draws a ran... 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!