- Pyroom
- Tutorials
- Python Turtle
- 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
- 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!
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!
More Python Turtle tutorials
- Draw spirals with loops in Python turtle · Intermediate
- Control a turtle with the keyboard · Advanced