Edexcel GCSE Computer Science 1CP2
Computational Thinking
Data
Computers
Networks
Issues and Impact
Problem Solving with Programming
Problem Solving with Programming
Turtle graphics
- 3 things to know
- Paper 2
Overview
Creating a turtle, moving and turning it, drawing shapes with loops, lifting and lowering the pen, pen colour, size and filled shapes, circles and arcs, setting position and heading, home and reset, standard and logo modes, speed, hiding the turtle, and the screen functions.
What you need to know
Answer each one before you reveal it.
What do hideturtle() and showturtle() do?
What do pen.left(90) and pen.right(90) do?
Questions from this subtopic
Each one with the model answer underneath.
- 1
How is a turtle created in a Python program?
Model answer
The line import turtle is followed by pen = turtle.Turtle(), which creates a turtle called pen. The turtle starts at the origin (0, 0) with its pen down.
- 2
What do pen.forward(100) and pen.back(100) do?
Model answer
The call forward(100) moves the turtle 100 steps the way it is facing, and back(100) moves it 100 steps the opposite way. Neither call turns the turtle, and a line is drawn if the pen is down.
- 3
What do pen.left(90) and pen.right(90) do?
Model answer
The call left(90) turns the turtle 90 degrees counterclockwise, and right(90) turns it 90 degrees clockwise. The turtle turns on the spot without moving.
- 4
What is drawn by for i in range(4): pen.forward(50), then pen.left(90)?
Model answer
The code draws a square with sides of 50 steps. The four 90-degree turns bring the turtle back to its start, facing its original direction.
- 5
How do penup() and pendown() differ?
Model answer
The call penup() lifts the pen, so the turtle moves without drawing. The call pendown() puts the pen back down, so later moves draw lines again.
- 6
What do pen.pencolor("red") and pen.pensize(5) change?
Model answer
The call pencolor("red") makes the lines drawn after it red. The call pensize(5) makes those lines 5 units wide.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Problem Solving with Programming, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.