Level 1 · turtle

Spinning Shape Art

A turtle draws a spinning pattern of shapes. Run the starter, then change it, upgrade it, and make it yours!

What it teaches: Drawing, loops, shapes

How to run

Starter file: starter_turtle_art.py

python starter_turtle_art.py

Starter code

"""
LEVEL 1 - TURTLE
Starter: Spinning Shape Art

Run this file. A turtle will draw a spinning pattern of shapes.
Your job: change it, upgrade it, make it yours!
"""
import turtle

# ---- Set up the drawing window ----
screen = turtle.Screen()
screen.title("Level 1 - Turtle Art")
screen.bgcolor("black")

artist = turtle.Turtle()
artist.speed(0)          # fastest drawing speed
artist.width(2)

colors = ["red", "orange", "yellow", "green", "cyan", "blue", "purple"]

def draw_shape(sides, size):
    """Draws one shape with the given number of sides and side length."""
    angle = 360 / sides
    for i in range(sides):
        artist.forward(size)
        artist.right(angle)

# ---- Draw a spinning pattern of shapes ----
for i in range(36):
    artist.color(colors[i % len(colors)])
    draw_shape(sides=6, size=100)   # try changing 6 (sides) or 100 (size)
    artist.right(10)                # turn a little before drawing the next one

artist.hideturtle()
screen.exitonclick()  # click the window to close


# ---------------------------------------------------------------
# LEVEL UP! Try one (or more) of these upgrades:
# 1. Change `sides` to draw triangles, pentagons, or stars.
# 2. Add turtle.speed() control from user input (ask the player how fast).
# 3. Make the size grow or shrink each loop (size = size + 2).
# 4. Add random colors using: import random / random.choice(colors)
# 5. Draw your name or initials using turtle.write() somewhere on screen.
# 6. Ask your AI tool: "How do I make this turtle drawing react to
#    keyboard arrow keys?" and try adding that.
# ---------------------------------------------------------------

Challenge ideas

Easy

  • Change the shape (sides) or size to make a totally different pattern.
  • Change the background color and the color list.

Medium

  • Make the pattern respond to keyboard keys (arrow keys change shape/color).
  • Add turtle.write("Your Name") to sign your art.
  • Make two turtles draw at the same time, in different colors.

Hard

  • Turn this into a simple drawing app: use arrow keys to move the turtle and draw freely, like an Etch-A-Sketch.
  • Save a screenshot of the canvas using turtle.getcanvas() and PostScript.

Ask your AI tool

How can I make my turtle drawing animate over time instead of drawing instantly?