For Exercise 1.12.3, digitCount
, the
easiest way to do this using what we already know is to have
10 base cases, one for each single-digit whole number.
Exercise 1.12.8 asks you to write a function that
computes the Fibonacci sequence, but doesn't specify a name.
Call it fib
.
Also, index the numbers in the sequence starting from 0. That is,
the 0th Fibonacci number is 0, the 1st is 1, the 2nd is also 1, the 3rd is 2,
etc.