You will build the Fibonacci numbers and test two identities that the lesson proves by induction.
The idea. and each later number is the sum of the two before it. The sum identity is . Cassini's identity is .
Your tasks.
fib_list(N). Return the list [0, 1, 1, 2, 3, 5, ...] of to , so that fib_list(N)[n] is .sum_rule(N). Return True when sum(F[1:n + 1]) == F[n + 2] - 1 for every n from 1 to N.cassini(n). Return .Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…