7.3 Iteration Flashcards
1
Q
Iteration
A
The repetition of a section of code
2
Q
Give some examples of iteration functions
A
- For
- While
- Do
3
Q
When to use a for loop
A
When you want to execute the loop a specified number of times
4
Q
When to use while loops
A
Execute the loop while a certain condition is true
5
Q
What is an infinite loop?
A
A loop continuing forever and no way to break it
6
Q
When to use do … until loops?
A
Execute the loop until a certain condition is true. The condition is tested at the end of the loop