You helped Alex build a honeycomb and a colorful flower. Great work! Now let’s have some fun with our turtle and create a spiral for Alex’s garden.

This is an optional challenge. Try the spiral below, or use the editor to draw your own shapes and designs!

1. Draw a growing spiral

In our earlier shapes, every line had the same length. A spiral winds around a center and grows outward. Let’s make each new line a little longer than the last one.

Use this fresh editor so you can keep your honeycomb and flower in the previous activity. Replace all the code in this editor with the following program, then press Run.

import turtle

turtle.shape("turtle")
turtle.speed(0)
turtle.color("blue")

for i in range(80):
  turtle.forward(i * 2)
  turtle.right(61)

Can’t see the editor? Open the Turtle editor in a new tab.

Here is what makes the spiral grow:

2. Make it your own

Before each experiment, predict what will change. Change one thing at a time, press Run, and compare the result with the starting spiral.

Try this changeWhat to look for
Change range(80) to range(40)Does the spiral grow as far?
Change i * 2 to i * 1How does the size change?
Change turtle.right(61) to turtle.right(60), then try turtle.right(90)How does the shape change?

Return to the starting code before trying a different experiment. Keep the spaces before the two lines inside the loop. If your drawing goes off the canvas, try fewer repetitions or a smaller number after *.

3. Extra challenge: repeat your favorite colors

Ready to add colors? First, return to the starting code. We will use a list, which stores several items in order. The list below is named colors. Each color name is a string inside quotation marks, and commas separate the items between the square brackets [].

Replace the entire for loop with this code. Keep the setup lines above it, including import turtle.

colors = ["red", "orange", "blue", "green", "cyan", "gold"]

for i in range(80):
  turtle.color(colors[i % len(colors)])
  turtle.forward(i * 2)
  turtle.right(61)

Press Run. The colors repeat in the same order as the turtle draws!

How does the turtle choose a color?

Your challenge: Choose your own colors, then make two different spirals for Alex’s garden. Explain which numbers you changed and how they affected your drawing. You can also create a completely different design!

Keep at least one color in the list, with quotation marks around each name and commas between names. Try ["blue", "green", "gold"] for a shorter repeating pattern. Change the angle or the number after * to make your second spiral different.

Help, I am stuck!

Check the Activity 11 answer key for complete examples and explanations.


Nuvi, the Nuevo Foundation mascot

You did it!
Workshop complete