How do four calls each named n avoid colliding — and what signals tell you a problem naturally wants recursion instead of a loop?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Define fact_recur(n) so that it returns n factorial for any integer n of 1 or more. Give it the two pieces every recursive function needs: a base case that stops at the smallest input, and a recursive step written in terms of fact_recur itself.
No loop, and no printing — just the returned number.
fact_recur from the factorial definition
Pull the leading n out of n times (n-1) times (n-2) down to 1, name the remaining product (n-1) factorial, and write the code with base case n == 1 returning 1.
Separate environments sharing one function name
Trace fact_recur(4) down to fact_recur(1), writing each environment's own n, the value each hands back to its own caller, and the returns 1, 2, 6 and 24.
Loop with a state variable versus recursion
Write factorial_iter with counter i over range(1, n+1) and state variable prod, then list the signals for recursion: unknown depth, nested directories, nested parentheses in an expression.