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.
XP
0Level 1Stars
0/15quest starsCombo
0clean runsRank
Seed0/160 Python scoreFirst recursive function
100 XPRocket 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
Your Python
recursive_countdown
Loading editor
Judge
Ready
Run your code when it feels ready.
