# Lesson 11: Drawing with Turtle
# WHAT TO DO: Turtle is a drawing tool built into Python. This program
# draws a shape with a loop: go forward, turn right, repeat. A square
# needs 4 sides, but the loop below repeats only 3 times. Fix line 18:
# change range(3) to range(4).
# HINT: Each repeat draws one side and one 90-degree turn, so 4 repeats
# make a square. Only change the number 3.
# NOTE: On a computer with no screen, Turtle cannot open its drawing
# window, so the program prints a message instead of drawing. That is
# expected there — run it in IDLE on your own computer to see the square.
# Run with F5 in IDLE. You are done when the drawing is a closed square.

import turtle

try:
    t = turtle.Turtle()
    t.color("blue")
    for side in range(3):  # <-- CHANGE THIS LINE: a square has 4 sides
        t.forward(100)
        t.right(90)
    turtle.done()
except Exception:
    print("Turtle needs a screen to draw.")
    print("In IDLE, this program draws a square: 4 sides of 100 steps.")
