Wrap up
Summary
-
whilerepeats code for as long as a condition is True -
forrepeats code for a specific number of iterations -
rangelets us control the start, end, and step size of aforloop -
You can solve many problems by updating a variable at each step in a loop
- total and average
- maximum and minimum
- finding and filtering
-
You can debug loops using
print, or by stepping through the code with a debugger like pythontutor