Community resourceWorkspace

1CP2-CT-6.WS1 First Turtle lines and state

Part 1 of 6 · 1CP2-CT-6 · Turtle practical lessons

The first practical Turtle lesson, where students run their own program and watch the drawing appear.

Students will:

  • set up a Turtle program and run it
  • move and turn the Turtle deliberately
  • raise and lower the pen to move without drawing
  • keep track of position, direction and pen state
  • change one instruction at a time and observe the effect

A Workspace lesson: students write and run their own Python in the editor. About 60 minutes.

Series: 1CP2-CT-6 · Turtle practical lessons, part 1 of 6.

Shared by Coding PathwayVerified teacher

  • 1 coding activity
  • About 60 minutes
  • CC BY-SA 4.0
  • Shared 17 Aug 2026

Preview

The whole resource, exactly as a class sees it. Answers and marking are held back.

First Turtle lines and state

What you will build

You will create a simple route-marker image made from straight lines. You will learn how the turtle's position, heading and pen state change as each instruction runs.

By the end, you should be able to:

  • create and name a turtle;
  • move it forwards and backwards;
  • turn it left and right by an angle;
  • lift and lower the pen;
  • decompose a small drawing into ordered line segments.

Before you begin

Open the supplied starter code. Run it once before making changes. A Turtle canvas should open and the named turtle artist should draw one short line.

Pearson's standard Turtle mode starts at (0, 0) facing east. A turn changes the heading; a movement changes the position. Movement draws only while the pen is down.

Stage 1: complete an L-shaped route

Find the Stage 1 comments. Add commands so artist:

  1. moves forward 120 units;
  2. turns left 90 degrees;
  3. moves forward 80 units.

Run the program. You should see two perpendicular line segments.

Check as you go

  • Is the first line horizontal?
  • Does the second line go upwards?
  • If it goes downwards, did you use right instead of left?

Stage 2: draw without joining

A route marker needs a separate underline. Use this exact movement pattern:

artist.penup()
artist.forward(30)
artist.pendown()

Change the movement and turns so the turtle reaches a sensible starting point for a separate 70-unit underline. The movement while the pen is up must not leave a line.

Stage 3: decompose a symbol

Choose one simple symbol built from straight segments, such as a flag, arrow, house outline or initial.

Before coding it, write a short plan in comments:

segment 1: move ... units while facing ...
turn: left/right ... degrees
segment 2: ...

Then implement the plan beneath the Stage 3 comment.

Success criteria

  • The program uses import turtle and turtle.Turtle().
  • The turtle is stored in the variable artist.
  • At least four line segments form a recognisable route marker or symbol.
  • At least one left turn and one right turn are used purposefully.
  • penup() and pendown() create at least one intentional gap.
  • Your decomposition comments match the implemented drawing.
  • The program ends with turtle.done().

Debugging prompts

  • Wrong direction: track the heading after every turn.
  • Wrong length: check the argument supplied to forward or back.
  • Unexpected line: the pen was probably down during repositioning.
  • No new line: check that pendown() runs before the drawing movement.
  • Canvas closes in another Python environment: keep turtle.done() as the last line.

Optional extension

Use pencolor("blue") and pensize(3) to make the symbol clearer. These methods will be taught more fully in lesson 3.

Evidence to hand in

Your teacher should be able to inspect the completed canvas, your program and the decomposition comments. Be ready to explain how one turn changed the turtle's heading.

Starter code
import turtle

artist = turtle.Turtle()
artist.speed("normal")

# The first command is complete. Run the program and inspect the line.
artist.forward(50)

# Stage 1: complete an L-shaped route.


# Stage 2: reposition with the pen up, then draw a separate underline.


# Stage 3: plan and draw your own straight-line symbol.
# segment 1:
# turn:
# segment 2:


turtle.done()