Answer: Turtle Challenge #395

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

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

The answers

How many squares will there be? 9. range(15, 195, 20) gives the sizes 15, 35, 55, 75, 95, 115, 135, 155, 175.

Where do all the squares start? From the same corner! The turtle never moves away from its starting point between squares, so they all share the bottom-left corner.

How the code works

There’s a loop inside a loop. The outer loop picks the size, and the inner loop draws a square of that size.

import turtle

t = turtle.Turtle()
t.speed(0)
t.pensize(3)
colours = ["royalblue", "limegreen"]
count = 0

for size in range(15, 195, 20):
    t.pencolor(colours[count % 2])
    for side in range(4):
        t.forward(size)
        t.left(90)
    count = count + 1

t.hideturtle()
turtle.done()

Try it: Can you make the squares grow from the middle instead? (This one is tricky!)