1. Pyroom
  2. Tutorials
  3. Python Turtle
  4. Draw a square with Python turtle

Draw a square with Python turtle

The turtle is a pen you move with code. Four moves and four turns make a square.

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

Steps

  1. Start with from turtle import star, so all turtle commands are ready.
  2. forward moves, left turns by 90 degrees. Repeat it four times with a for loop.
  3. Press Run and watch the turtle draw in the preview.
  4. Change 4 to 6 and 90 to 60 to draw a hexagon. Experiment!
Read the transcript

Start with from turtle import star, so all turtle commands are ready.

forward moves, left turns by 90 degrees. Repeat it four times with a for loop.

Press Run and watch the turtle draw in the preview.

Change 4 to 6 and 90 to 60 to draw a hexagon. Experiment!

Try it in the Playground

Nothing to install and no account needed.

Open Playground →