Lecture 10 – More Iteration (for loops)

Data 6, Summer 2021

Review

Quick Check 1

Example: missing number

Quick Check 2

Example: Luhn's algorithm

What if I accidentally swap two digits?

Now Luhn's algorithm can tell me the credit card number is invalid, which likely means I made a typo.