Question: Activity 7: Write a program to draw the image shown below by calling drawSquare function. There are five squares to draw. Although you may write

 Activity 7: Write a program to draw the image shown below

Activity 7: Write a program to draw the image shown below by calling drawSquare function. There are five squares to draw. Although you may write five statements to call drawSguare function, five penup statements, five.., what if you have to draw twenty squares or even more? Notice that no matter how many squares to be draw in the following image, the process is repeated. Can we use a for loop? Each square has the same size, but starts from different position. Assume the first one starts from (0, 0), the second one (-25, -25), the third one (-50, -50 import turtle def drawSquare(t, sz) """Make turtle t draw a square with side sz.""" for j in range(4) tlef(90) # Set up the window and its attributes als, turtls.ZutisO create alex #change pen color to hot pink # # Contis your rest of the codes here

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!