Chapter 03
Loops
循环
Do something many times. for / range, while, break — and the four patterns (accumulator, counter, tracking variable, while-true) that cover 95% of beginner loops. Strictly aligned with Think Python §7.1–§7.4.
Strict source: Think Python §7.1–§7.4 (Multiple Assignment · Updating Variables · The while Statement · break).
Lessons in this chapter
- 03.00 Worked ExampleWalkthrough: Countdown例题: 倒计时python-loops8 min
- 03.01 ExerciseSum 1..n1 到 n 求和python-loops15 min
- 03.02 ExerciseFizzBuzzFizzBuzzpython-loops python-conditionals20 min
- 03.03 ExerciseFind the Max找最大值python-loops15 min
- 03.04 HomeworkHomework: Collatz Steps作业: Collatz 步数python-loops python-conditionals30 min