Chapter 09
Recursion
递归
A function calls itself. With a base case to stop, recursion is the cleanest way to express problems that are naturally self-similar — factorial, fibonacci, list traversal, Euclid’s GCD. Strictly aligned with Think Python §5.7-§5.10 + §6.6-§6.9.
Strict source: Think Python §5.7-§5.10 + §6.6-§6.9
Lessons in this chapter
- 09.00 Worked ExampleWalkthrough: Recursive Countdown例题: 递归倒计时python-recursion8 min
- 09.01 ExerciseFactorial阶乘python-recursion15 min
- 09.02 ExerciseFibonacci斐波那契数列python-recursion20 min
- 09.03 ExerciseSum List Recursively递归求列表和python-recursion python-lists15 min
- 09.04 HomeworkHomework: GCD + Power作业: 最大公约数 + 幂python-recursion45 min