Chapter 16
Loops
Learning Objectives
Upon completing all the content in this chapter, you should be able to do the following:
- Use loops:
for
andwhile
. - Modify the flow of control in loops using
break
andcontinue
. - Explain the difference between
break
andcontinue
.
Key Terminology
Here is a list of key terms for this chapter, broken down by the page upon which the term first appears. Make note of these terms and the definitions as you read through this chapter.
Iteration
- iteration
- DRY
- zero-based indexing
For Loops
- for loops
- definite iteration
- loop variable
- zero-based indexing
More on Range
- start value
- stop value
- step value
While Loops
- while loop
- input validation
- indefinite iteration
Infinite Loops
- infinite loop
Ending Loops with a Break
- break
- continue