Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
BYU Math 495R
BYU Math 495R
  • About This Course
  • Setting Up Google Colab
  • Lab 1: LaTeX
    • LaTeX Basics
    • Typesetting Mathematics
    • Page Elements
    • The Process
    • Exercises
    • Bonus: Customization
  • Lab 2: Plotting
    • Line Plots
    • Scatter Plots and Histograms
    • Visualization and Analysis
    • Exercises
  • Lab 3: More Loops
    • Loop Tools
    • Nested Loops
    • The WHILE Loop
    • Exercises
  • Lab 4: Iterables
    • Tuples and Lists
    • Sets and Dictionaries
    • Itertools
    • Exercises
  • Lab 5: The Caesar Cipher
    • Encryption and Ciphers
    • Strings
    • Caesar (Shift) Cipher
    • Exercises
  • Lab 6: The Vigenère Cipher
    • Vigenère Encryption
    • Finding the Key Length
    • Exercises
  • Lab 7: Cracking Ciphers
    • Cipher Cracking Strategy
    • Caesar Groups
    • Cracking the Cipher
    • Exercises
  • Common Errors
Back to top

Lab 3: More Loops¶

Open Lab Notebook in Google Colab

Learning Objectives

  1. Use enumerate(), zip(), and reversed() to customize how a for loop iterates.

  2. Arrange nested loops and calculate the number of iterations.

  3. Construct while loops for tasks where the number of required iterations is not known beforehand.

Lab Outline

  • Loop Tools
  • Nested Loops
  • The WHILE Loop
  • Exercises
Next
Loop Tools
Previous
Exercises
Copyright © 2026, Brigham Young University Department of Mathematics
Made with Sphinx and @pradyunsg's Furo