LINKS TO FULL CONTENT
Full lesson: https://computersciencecamp.com/cours...
Full course: https://computersciencecamp.com/cours...
FULL LESSON DESCRIPTION
In this lesson I’ll introduce two Python keywords, called ‘break’ and ‘continue’, that allow us to alter the natural behavior of a loop, offering additional flexibility to control the repeated sequences of statements in our code. I’ll say a word or two about how to avoid getting stuck in infinite loops. And as always, we’ll conclude with a practice problem for you to internalize this new material.
FULL LESSON CONTENT
Part 1. The ‘break’ statement
Part 2. The ‘continue’ statement
Part 3. Infinite loops
Part 4. Problem: calculation of an average