← Years 5–6 Creating Digital Solutions

REPEAT a set number of times

Runs the indented steps under it exactly n times, then moves on to the next step. Use END REPEAT to show where the loop stops. Example: REPEAT 5 TIMES.

Understanding REPEAT a set number of times in Years 5–6 Creating Digital Solutions

What it does: The number after REPEAT is how many times the indented step runs, so 3 gives three claps. Jump runs twice inside the loop. Sit down is not indented, so it runs one time at the end. END REPEAT closes the loop so we know which steps are repeated. A square has 4 sides, so the draw-and-turn steps must run 4 times. Total goes 0, 2, 4, 6. Adding 2 happens 3 times, so the total is 6. Every counted loop must finish with END REPEAT so the next step is clearly outside the loop.

Common mistakes: A counted loop must finish with END REPEAT. END LOOP is not the right keyword. Line 4 should be END REPEAT. The loop needs a number to say how many times to repeat. Line 1 should be REPEAT 5 TIMES.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 11–20) and word search (Modules 1–20).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which pseudocode makes a robot clap 3 times?
REPEAT clap 3 TIMES END REPEATREPEAT 3 TIMES clap END REPEAT
Matches
REPEAT 4 TIMES Step forward END REPEAT
↓
The step inside the loop is not indented, so it is not clear which step gets repeated. Indent Step forward under REPEAT 4 TIMES.
Applying
Meanings
Term
REPEAT n TIMES
Meaning
Runs the indented steps under it exactly n times, then moves on to the next step. Use END REPEAT to show where the loop stops. Example: REPEAT 5 TIMES.
Practice
START
Testing
Gaps
3 TIMES
Check Answer
Spots
3 Bounce the ball
4END LOOP

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Cosmic Dragon' badge — Orbit Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which pseudocode makes a robot clap 3 times?
A. REPEAT 3 TIMES clap END REPEAT ✓
B. REPEAT clap 3 TIMES END REPEAT
The number goes straight after REPEAT, then TIMES. The step to repeat is indented underneath.
2. How many times does 'jump' run? REPEAT 4 TIMES jump END REPEAT
A. 1 time
B. 4 times ✓
The number after REPEAT tells you how many times the indented steps run. Here it is 4.
3. Which line shows where a REPEAT loop stops?
A. STOP JUMP
B. END REPEAT ✓
END REPEAT closes the loop so we know which steps are repeated.
4. A student wants to draw a square with 4 equal sides. Which number should they choose for REPEAT ___ TIMES (draw a side, turn right)?
A. 4 ✓
B. 2
A square has 4 sides, so the draw-and-turn steps must run 4 times.
5. Which loop body is set out correctly?
A. REPEAT 2 TIMES step forward turn left END REPEAT ✓
B. REPEAT 2 TIMES step forward turn left END REPEAT
The steps to repeat are indented under the REPEAT line. Without indenting, it is hard to see what is inside the loop.

Match the Pairs

REPEAT 5 TIMES → Runs the indented steps under it exactly 5 times, then moves on to the next step
END REPEAT → Marks the place where the loop stops and shows the steps inside are finished
To clap 3 times, put the number 3 in the loop and indent the clap step → REPEAT 3 TIMES Clap END REPEAT
A step written after END REPEAT runs only once, after the loop has finished → REPEAT 2 TIMES Jump END REPEAT Sit down
REPEAT 4 TIMES Step forward END REPEAT → The step inside the loop is not indented, so it is not clear which step gets repeated. Indent Step forward under REPEAT 4 TIMES.
REPEAT 6 TIMES Stamp Sit down → END REPEAT is missing, so there is no sign of where the loop stops. Add END REPEAT after Stamp.

Key Term

REPEAT n TIMES
Runs the indented steps under it exactly n times, then moves on to the next step. Use END REPEAT to show where the loop stops. Example: REPEAT 5 TIMES.

Fill in the Blanks

1. REPEAT 3 TIMES Jump END REPEAT
Hint: Type the keyword that starts a counted loop.
2. REPEAT 5 TIMES Draw a side and turn END REPEAT
Hint: Type the number of times needed to draw every side of a pentagon.
3. REPEAT 4 TIMES Hop forward END REPEAT
Hint: Type the two-word line that shows where the loop stops.
4. REPEAT 6 TIMES Roll the dice END REPEAT
Hint: Type the word that comes after the number in the loop's first line.
5. REPEAT 3 TIMES Knock on the door END REPEAT
Hint: Type the number of knocks that makes a triple knock.

Spot the Error

Question 1
A Get the ball
B REPEAT 4 TIMES
C Bounce the ball
D END LOOP
Line D — A counted loop must finish with END REPEAT. END LOOP is not the right keyword. Line 4 should be END REPEAT.
Question 2
A REPEAT TIMES
B Jump
C END REPEAT
D Sit down
Line A — The loop needs a number to say how many times to repeat. Line 1 should be REPEAT 5 TIMES.
Question 3
A REPEAT 3 TIMES
B Draw a line
C STOP REPEAT
D Draw a circle
Line C — A counted loop must finish with END REPEAT. STOP REPEAT is not the right keyword. Line 3 should be END REPEAT.
Question 4
A LOOP 3 TIMES
B Stomp your feet
C END REPEAT
D Stop
Line A — A counted loop starts with the word REPEAT, not LOOP. Line 1 should be REPEAT 3 TIMES.
Question 5
A Goal: run 4 laps
B REPEAT 4 TIMES
C Run 4 laps
D END REPEAT
Line C — The body should run just one lap each time. Running 4 laps inside a loop that repeats 4 times would give 16 laps. Line 3 should be ' Run one lap'.

Student with a class code? Join your class →