Coding Loops: Repeating Actions in Scratch
Lesson preview: the Mini Lesson and Vocabulary are open to everyone. Guided practice, exercises, the parent checklist and the printable PDF worksheet come with full access (free 7-day trial or membership).
Learning Objectives
- 1Explain what a loop is and why programmers use them
- 2Identify the "repeat X times" block in Scratch and describe what it does
- 3Predict the outcome of a loop given the action and the number of repeats
Mini Lesson
A loop is a block in Scratch that makes the computer repeat an action more than once without writing the same block many times. Instead of stacking "move 10 steps" ten separate times, you place one "move 10 steps" block inside a "repeat 10" loop. This saves time, makes code shorter, and is easier to read.
Types of Loops in Scratch
- "Repeat X times" — runs the blocks inside it exactly X times, then stops.
- "Forever" — runs the blocks inside it continuously until the red Stop button is pressed.
- "Repeat until <condition>" — keeps repeating until a specific condition becomes true.
Reading a Loop
Every "repeat X times" loop has three parts you need to understand: (1) how many times it repeats, (2) the action (or actions) inside the loop, and (3) the expected outcome after all the repeats are done. For example, "repeat 4 times / move 10 steps" will move the sprite a total of 40 steps.
To calculate the total effect of a loop, multiply the repeat number by the effect of one action. Repeat 5 × move 10 steps = 50 steps total.
Unlock the full HSEA system for 7 days.
Add your first kid profile and your 7 days start: every lesson in every grade, saved progress for each child. Nothing to set up, no card required, nothing to cancel.
- ✓ All 1,680 lessons, Grades 1–6, every subject
- ✓ Profiles + saved progress for every kid
- ✓ Printable lessons with answer key