Fibonacci, recursively
The Fibonacci numbers start 0, 1 and each one after that is the sum of
the two before it: 0, 1, 1, 2, 3, 5, 8, 13, …. Write fib(n) that
returns the n-th one, counting from fib(0) = 0.
fib(0) -> 0
fib(1) -> 1
fib(7) -> 13
fib(20) -> 6765
The point is to practise recursion with two base cases and two recursive
calls. The checks stay at n of 25 or less, where the straightforward
version is still quick.
def fib(n):
...