
This code introduces using a loop for drawing shapes.
import turtle
pen=turtle.Turtle()
for i in range (0,4):
pen.forward(100)
pen.right(90)
Run the code and see what happens. Can you change the pen.right(90)
code to a different number so it draws a hexagon instead?
HINT: Change the 4
so it loops more than four times.
This lesson is part of the Simple Python Challenges Course