Community resourceWorkspace

1CP2-CT-6.WS2 Coordinates polygons and reusable shapes

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

The second practical lesson, moving from single lines to closed shapes drawn by iteration.

Students will:

  • move to a coordinate before starting to draw
  • draw a regular polygon using a loop
  • calculate the turn angle a polygon needs
  • turn a repeated shape into a reusable subprogram
  • draw the same shape in more than one place

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

Series: 1CP2-CT-6 · Turtle practical lessons, part 2 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.

Coordinates, polygons and reusable shapes

What you will build

You will create a row of regular polygon tiles positioned at different coordinates. Repetition will draw each polygon, and a parameterised procedure will make the shape reusable.

By the end, you should be able to:

  • reposition a turtle using Cartesian coordinates;
  • use setheading to make direction predictable;
  • calculate the exterior turn for a regular polygon;
  • use a for loop to repeat sides;
  • define and call a procedure with parameters.

Before you begin

You should already be able to use forward, left, right, penup and pendown.

The origin is (0, 0). Negative x-values are left of the origin and positive y-values are above it. Use this pattern whenever you reposition without drawing:

artist.penup()
artist.setposition(-150, 80)
artist.setheading(0)
artist.pendown()

In standard mode, heading 0 points east, 90 points north, 180 points west and 270 points south.

Stage 1: complete a square procedure

Find draw_square(size) in the starter code.

Inside its loop, add the two commands needed to draw one side and turn through the square's exterior angle. Call the procedure with draw_square(60).

Check as you go

  • Does the loop repeat four times?
  • Is each turn 90 degrees?
  • Does the turtle finish at its starting point and heading?

Stage 2: generalise to a regular polygon

Complete draw_polygon(sides, length).

Calculate the turn with:

turn = 360 / sides

The loop should repeat sides times. Each pass moves length units and turns through turn degrees.

Test it with:

draw_polygon(3, 70)
draw_polygon(6, 45)

Reposition between calls so the shapes do not overlap.

Stage 3: create a tile row

Draw at least three polygon tiles at different x-coordinates. Use a different combination of sides and length for each call.

Your main program should show its structure clearly:

  1. reposition safely;
  2. set a known heading;
  3. call the reusable procedure;
  4. repeat for the next tile.

Success criteria

  • setposition(x, y) is used with the pen up.
  • setheading(0) or another deliberate heading makes each start predictable.
  • draw_polygon has sides and length parameters.
  • A for loop draws the polygon sides.
  • The turn is calculated from 360 rather than hard-coded for one shape.
  • At least three non-overlapping regular polygons are visible.
  • The same procedure is reused with different arguments.

Debugging prompts

  • Shape does not close: check that 360 / sides is used and the loop repeats exactly sides times.
  • Joining line between tiles: lift the pen before setposition.
  • Shapes point in inconsistent directions: set a known heading before each call.
  • Procedure draws only one kind of shape: check that the loop and turn use the parameters.

Optional extension

Add a third parameter named angle_offset. Use it with setheading(angle_offset) before drawing so tiles can be rotated deliberately.

Evidence to hand in

Your teacher should see at least three polygon calls, the reusable procedure and the completed canvas. Be ready to explain why the exterior angles total 360 degrees.

Starter code
import turtle

screen = turtle.Screen()
screen.setup(800, 600)

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


def draw_square(size):
    for side in range(4):
        # Draw one side and turn through the exterior angle.
        pass


def draw_polygon(sides, length):
    turn = 360 / sides
    # Repeat the movement and turn for every side.
    pass


# Stage 1: position the turtle and test draw_square(60).


# Stage 2: test draw_polygon with at least two polygons.


# Stage 3: create a row of at least three non-overlapping tiles.


turtle.done()