Computer Science glossary Β· Grade 2 to Grade 9
Repetition
Also called: loop, iteration
What it means
Repetition is when a program repeats the same steps more than once. A loop can repeat a set number of times, or keep going until something happens.
Examples
- Drawing a square: repeat 4 times (move forward 10, turn right 90 degrees).
- Clap your hands until the music stops.
- A game keeps checking for key presses in a loop that runs forever.
For teachers
Repetition, or iteration, is the control structure that repeats a block of instructions. Count-controlled loops repeat a fixed number of times ("repeat 4"), while condition-controlled loops repeat while or until a condition is met. Students first spot repeated steps in a long sequence and replace them with a loop, which makes the algorithm shorter and easier to change; a classic example is drawing a square with "repeat 4: forward, turn right".
Common misconception
Students may think a loop does something different each time it repeats. A loop runs the same instructions each time; anything that changes (such as a score) changes because a variable is updated inside the loop.
Lesson plans that teach it
- Unplugged Algorithms: Program the TeacherGrade 3 Β· free lesson plan with worksheet