12.0 Repetition Introduction

Learn more about loops by completing these puzzles.

Very frequently in computer programming, we would like to repeat specific actions. Sometimes we want to repeat these actions a specific number of times: drawing 1000 circles on the screen. Other times, we want to repeat some actions if some specified condition (i.e., Boolean expression) is True: for example, keep asking for a password until it is entered correctly. Additionally, sometimes we'd like to repeat some action(s) for every element of data in some collection of data elements: for example, for every student's grade in CS 20, give a 5% bonus. In Python, we can do all these things using loops.