What does iteration mean?
Repeating a set of instructions, either a fixed number of times (count-controlled, a for loop) or while a condition holds (condition-controlled, a while loop). One of the three basic programming constructs.
In a lesson
To drive a square you could write forward, turn, forward, turn, forward, turn, forward, turn. Eight lines for one idea repeated four times. A loop writes the idea once and says how many times. Repeating code is called iteration, and a loop that runs a set number of times is count-controlled.
Learn it
- Taught in F2.5 Count-controlled loops: for Decisions and loops, GCSE
Used in
- F1.1 What a program is
- F2.6 Condition-controlled loops: while
- F2.7 Loop patterns
- F3.4 Iterating over a list
- F5.3 Pseudocode and the exam reference language
- F13.9 Project: the revision robot
- A1.1 Data types and programming constructs
- A1.6 Programming paradigms and procedural programming
- A2.3 Recursion versus iteration
- A2.7 Thinking ahead and thinking logically
and 14 more lessons.
Do the lesson in the simulator