Repeating Work with Loops
Use for loops and range() to repeat work, keep running totals, use while loops safely, and control loops with break and continue: the heart of automating repetitive tasks.
Part of Python for AI and Data, module 2: Decisions, Loops and Collections
What you will learn
- Task 1: The for loop
- Task 2: Counting with range()
- Task 3: Running totals: the accumulator pattern
- Task 4: while loops, and how not to get stuck
- Task 5: break and continue
Key terms in this lesson
Start learning free
This lesson is part of the Premium. Create a free account to start with the free lessons first.
← Making Decisions with if, elif and else · Lists and Dictionaries →