Exam-style question
Try this first
Which function has a general case that moves its argument towards the base case?.
- A.```python def count(n): if n == 0: return count(n - 1) ```
- B.```python def count(n): if n == 0: return count(n + 1) ```
- C.```python def count(n): return count(n) ```
- D.```python def count(n): if n == 0: return count(10) ```
Model answer
What a good answer should say
- ```python def count(n): if n == 0: return count(n - 1) ```
Explanation
Why this works
The function stops when n is 0 and decreases n on each general-case call, so the calls move towards the base case.
Common mistake
No common mistake is linked to this question yet.
