Answer: Turtle Challenge #99

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

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

The answers

How many dots will there be? 4 rows × 3 columns = 12 dots.

What pattern do the colours make? Stripes: every row is one colour, and the colours take turns from row to row.

Why is there t.penup() at the start? So the turtle doesn’t draw lines between the dots as it moves.

How the code works

Two loops, one inside the other, visit every spot in a grid. t.goto(x, y) jumps the turtle to each spot and t.dot stamps a dot there.

import turtle

t = turtle.Turtle()
t.speed(0)
t.penup()

for row in range(4):
    for col in range(3):
        t.goto(col * 40, row * 40)
        t.dot(20, "orange" if row % 2 == 0 else "limegreen")

t.hideturtle()
turtle.done()

Try it: Change the numbers in the two range()s to make a bigger grid.