Today, we
- Reviewed for loops
- Learned about the range function
- range(5) -> 0, 1, 2, 3, 4
- range(5, 10) -> 5, 6, 7, 8, 9
- Used range to repeat code a certain number of times
- Made a for loop that prints the even numbers from 100 to 106
- Modulo (%) is the remainder operator
- If x % 2 is 0, then x is even
Homework
- Try code from pages 57-58 of the textbook, and save it to aug_8_for_loop_hw3.py
If you have any questions, feel free to email me at isaac@ayclogic.com.