← Previous Next →

The Fibonacci sequence

Created by Julien Palard


Provide a function that prints the n first numbers of the fibonacci sequence.

Name your function fibonacci and take a single parameter, say n.

Your function should return a list of n values from the sequence.


>>> fibonacci(2)
[1, 1]
>>> fibonacci(5)
[1, 1, 2, 3, 5]