Answer: Turtle Challenge #115

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

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

The answers

How many dots will there be? 6 rows × 7 columns = 42 dots.

What pattern do the colours make? A checkerboard: the colour swaps every dot, like a chess board.

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(6):
    for col in range(7):
        t.goto(col * 40, row * 40)
        t.dot(20, "gold" if (row + col) % 2 == 0 else "mediumpurple")

t.hideturtle()
turtle.done()

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