Chapter 15 - Python Quest
Tower of Hanoi Recursion
Move smaller towers, pause calls with changing peg roles, and combine each recursive plan on the return trip.
Rocket Countdown Chain
A launch computer builds its countdown by asking a smaller launch computer to finish the rest of the numbers.
Write recursive_countdown(number) so it returns [number, number - 1, ..., 1]. Return [] for 0. Solve it with recursion and no for or while loop.
Sample checks
recursive_countdown(4)returns[4,3,2,1]Explanation: the 4 call keeps 4 in front, then the smaller 3 call contributes 3, 2, 1 as its complete returned countdown
recursive_countdown(1)returns[1]Explanation: the 1 call contributes its current number, while the smaller 0 call reaches the stopping case and contributes an empty list
Hint
Hints are ready when you want one.
Lesson reference
Review: Shrink toward the base case
Work through this question together. Ask why, share a hint, or explain your approach.
Your Python
recursive_countdown
Judge
Ready
Run your code when it feels ready.
