3. Control Statements
Objectives
In this chapter, you’ll:
Make decisions with if
, if
else
and if
elif
else
.
Execute statements repeatedly with while
and for
.
Shorten assignment expressions with augmented assignments.
Use the for
statement and the built-in range
function to repeat actions for a sequence of values.
Perform sentinel-controlled iteration ...
Get Python for Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.