Answer: Turtle Challenge #292

Here’s what the code from Turtle Challenge #292 draws. This picture was made by running the code for real.

The drawing made by turtle challenge 292.
What the turtle drew.

The answers

What shape does the shape function draw? A hexagon (6 sides, turning 60 degrees each time).

How many of those shapes will you see? 10 of them, spun around the middle.

How many lines does the turtle draw altogether? 10 × 6 = 60 lines.

How the code works

The function shape is a new word we taught Python. The main loop uses it 10 times, turning 36 degrees in between, so the hexagons spin round in a ring.

import turtle

t = turtle.Turtle()
t.speed(0)
colours = ["seagreen", "mediumpurple", "limegreen"]

def shape(size):
    for side in range(6):
        t.forward(size)
        t.left(60)

for i in range(10):
    t.pencolor(colours[i % 3])
    shape(60)
    t.left(36)

t.hideturtle()
turtle.done()

Try it: Change shape(60) to shape(i * 5). What happens?