Question: 1.36. Write a function that draws a series of 10 squares, with each square being 5 pixels smaller on each side. The squares should all

1.36. Write a function that draws a series of 10 squares, with each square being 5 pixels smaller on each side. The squares should all start at the same location.

import turtle

fred=turtle.Turtle()

def drawSquare(myTurtle, sideLength):

myTurtle.forward(sideLength)

myTurtle.right(90)

myTurtle.forward(sideLength)

myTurtle.right(90)

myTurtle.forward(sideLength)

myTurtle.right(90)

myTurtle.forward(sideLength)

myTurtle.right(90)

def drawNestedSquares(myTurtle):

for i in range(200, 150, -5):

drawSquare(myTurtle,i)

drawNestedSquares(fred)

1.37. Redo 1.36 so that the squares are all centered.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!