Jupyter Notebook Lab — Module 04#

Loops & Iteration

Practice writing for and while loops with accumulator patterns, loop control statements, and combined loop + branching logic applied to customer transaction data.


Download#

📓 Student Notebook .ipynb 🔑 Answer Key coming soon

Open the .ipynb file in Google Colab by selecting File → Upload notebook.


What You’ll Practice#

  1. Writing for loops to iterate through lists and dictionaries
  2. Building accumulator patterns — totals, filtered lists, summary dicts
  3. Combining loops and branching for customer classification
  4. Writing while loops with appropriate stopping conditions
  5. Using break and continue to control loop execution

Learning Objectives#

By completing this notebook you will be able to:

  • Write for loops that iterate through lists and dictionaries
  • Apply the accumulator pattern to build totals, filtered lists, and summary dictionaries
  • Combine for loops with if/elif/else blocks for data classification
  • Write while loops with correct stopping conditions
  • Predict the output of a loop before running it

Next Module: Module 05 — Functions & Abstraction →