Lesson
Turtle graphics with Python
A PRIMM lesson on drawing shapes with Turtle, using loops, angles, and repeated movement.
Lesson overview
- Topic
- Turtle graphics
- Level
- GCSE
- Learning objective
- Use Turtle commands and loops to draw a repeated shape and explain how the turn angle affects the result.
1.Predict
Example code
import turtle
t = turtle.Turtle()
for _ in range(4):
t.forward(100)
t.left(90)- What shape do you think the turtle will draw by the end of the loop?
- How many times will the turtle move forward before the program stops?
2.Run
Open the code in Paired, run it, and compare the drawing with your prediction.
3.Investigate
- The loop repeats the same two commands several times.
- Each forward command draws one side, and each left turn changes the direction for the next side.
- Why does left(90) help the turtle make a square?
- What role does range(4) play in the program?
- What shape would appear if the turn angle changed but the loop still ran 4 times?
4.Modify
- Change the distance so the square is larger or smaller.
- Change the angle and observe how the drawing changes.
- Add a colour or pensize command before the loop starts.
5.Make
Create your own Turtle program that draws a different repeated shape, such as a triangle, hexagon, or simple pattern.
Extension
Use another loop or a colour change to build a repeating pattern and explain how your angles control the final design.
Need extra support?
Reece offers GCSE & A-Level Computer Science tutoring: reece-tutoring.co.uk