Chapter 9: Repeating with Loops
Learning Objectives
Upon completing all the content in this chapter, you should be able to do the following:
- Use iteration to repeat the execution of a code block
- Properly write
for
andwhile
loops - Use
for
andwhile
loops in appropriate contexts
Key Terminology
Here is a list of key terms for this chapter broken down by the page the term first appears on. You should make note of these terms and their definitions.
Iteration
- iteration
- DRY
for
Loops
for
loop- definite iteration
- initial expression
- loop condition
- update expression
- loop variable
- loop body
Breaking Down the for
Statement
- infinite loop
The Accumulator Pattern
- pattern
- accumulator pattern
- accumulator
while
Loops
- input validation
Choosing Which Loop to Use
- definite iteration
- indefinite iteration