Your question is Writing Fibonacci Function. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
State Street analytics workflows may use Fibonacci-like sequences for testing numerical pipelines. Write a function that returns the first n numbers in the Fibonacci sequence.
Define the sequence as F(0) = 0, F(1) = 1, and F(k) = F(k - 1) + F(k - 2) for k >= 2.
Given a non-negative integer n, return a list containing exactly the first n Fibonacci numbers, starting with F(0). For n = 0, return an empty list.
def fibonacci_sequence(n):