A turtle walks across the screen, leaving a line behind. Your program tells it where to go.
- Predict: Read the code and say what it will do before you run anything.
- Run: Run it and compare the result with your prediction.
- Investigate: Trace how each line of code connects to what you see.
- Modify: Change the code on purpose and check the result.
- Make: Build something new using what you have learned.
PredictRead the code and say what it will do before you run anything.
Predict
square.py
from turtle import *
forward(100)
right(90)
forward(100)
right(90)
forward(100)
right(90)
forward(100)
right(90)
Read the code. What shape will the turtle draw? Where will it finish?
Reveal what happens
PredictRunRun it and compare the result with your prediction.
Run
Run the program and compare it with your prediction.
square.py
from turtle import *
forward(100)
right(90)
forward(100)
right(90)
forward(100)
right(90)
forward(100)
right(90)
Try it yourselfYour edits are saved in this browser.
InvestigateTrace how each line of code connects to what you see.
Investigate
The same square, in fewer lines. Which part repeats? What does range(4) control?
square.py
from turtle import *
for i in range(4):
forward(100)
right(90)
InvestigateModifyChange the code on purpose and check the result.
Modify
Change the loop to draw a triangle. Hint: the turtle turns by an exterior angle.
Try it yourselfYour edits are saved in this browser.
MakeBuild something new using what you have learned.
Make
Design your own shape or pattern. Try color-style commands such as pencolor("red").
Try it yourselfYour edits are saved in this browser.