1. Pyroom
  2. Tutorials
  3. Python Turtle
  4. Draw spirals with loops in Python turtle

Draw spirals with loops in Python turtle

A spiral is a square whose sides keep growing. The loop variable makes each step a little longer.

Intermediate Video coming soon. The steps below show everything the video will cover.

Steps

  1. Speed up the turtle and pick some colours.
  2. In the loop, step grows by one each time, so every line is a little longer.
  3. Run it. Turning 91 degrees instead of 90 makes the square twist into a spiral.
  4. Change 91 to 121 and run it again: one number, a completely different pattern.
Read the transcript

Speed up the turtle and pick some colours.

In the loop, step grows by one each time, so every line is a little longer.

Run it. Turning 91 degrees instead of 90 makes the square twist into a spiral.

Change 91 to 121 and run it again: one number, a completely different pattern.

Try it in the Playground

Nothing to install and no account needed.

Open Playground →