When to use it
Use turtle for a first programming course, geometry and pattern lessons, or any time students learn best by seeing the result of each line.
Start drawing
Write from turtle import * at the top of your program. When you press Run, a preview panel opens next to the console and the turtle draws as your code executes. Use forward(), left(), right(), pencolor() and fillcolor() to control it.
from turtle import *
for side in range(4):
forward(100)
left(90)
From shapes to patterns
Once a square works, put it in a loop and turn a little each time β a rosette appears. Change one number, run again and watch the pattern change. This is the fastest way to build a feeling for what a loop really repeats.
Learning path
- Beginner: draw a square and change its size and colour.
- Intermediate: draw spirals with loops and growing step sizes.
- Advanced: react to the keyboard with
onkey() and animate the turtle.
Good to know
Pyroom runs turtle in the browser, so it works on Chromebooks, tablets and phones. Use speed(0) or tracer() for faster drawings. Share a drawing with a link or QR code so classmates can run it too.
Feature overview β