Iteration/Loops (FOR and WHILE)
Loops repeat instructions. You will use FOR loops when you know how many repetitions are needed and WHILE loops when you do not, and see what causes an infinite loop.
Key terms
- Iteration
- Repeating a block of code.
- FOR loop
- Repeats a fixed number of times.
- WHILE loop
- Repeats while a condition is true. Best when the number of repetitions is unknown.
- Infinite loop
- A loop whose condition never becomes false, so it never ends.
Part of Programming.