3. More On Flow of ControlΒΆ
You have varied the normal forward sequence of operations with
functions and for
loops. To have full power over your programs,
you need two more constructions that changing the flow of control:
decisions choosing between alternatives (if
statements), and
more general loops that are not required to be controlled by the
elements of a collection (while
loops).
- 3.1. If Statements
- 3.2. Loops and Tuples
- 3.3. While Statements
- 3.4. Arbitrary Types Treated As Boolean
- 3.5. Further Topics to Consider
- 3.6. Summary