# Lab 5 - Exercise 2 - Problem (Exploration Exercise) 3 # # Let’s add some code to the main part of our Python program such that # it now draws a black square. Let’s make sure we use a for loop. # # Now, let’s be bad and copy/paste this code 2 more times such that our # program produces the black squares illustrated in our Lab 5. # # We will have to add some code to move our turtle such that it draws the # black squares in the three locations illustrated in our Lab 5. # # Anne Lavergne # March 2017 import turtle as t # MAIN part of program - Top Level t.setup(width=600, height=500) t.pencolor('black') t.penup() t.goto(-75,40) t.pendown() # Square 1 for side in range(4): t.forward(50) t.right(90) t.penup() t.forward(90) t.pendown() # Square 2 for side in range(4): t.forward(50) t.right(90) t.penup() t.forward(90) t.pendown() # Square 3 for side in range(4): t.forward(50) t.right(90)