A function counts calls to itself, and its only way out is a test for exactly zero. def steps(n): if n == 0: return 0 return 1 + steps(n - 2) print(steps(5)) What is the result of running this program?
RecursionError
3
2
0
Log in to join the discussion.
Loading…