Virtu Financial monitoring components may use predictable numeric sequences when validating data-processing behavior. Implement a function that generates the first n Fibonacci numbers and supports both recursive and iterative strategies.
The Fibonacci sequence is defined as F(0) = 0, F(1) = 1, and F(k) = F(k - 1) + F(k - 2) for k >= 2.
Implement fibonacci_sequence(n, method):
n is a non-negative integer representing the number of terms to return.method is either "recursive" or "iterative".F(0) through F(n - 1) in order.n == 0.def fibonacci_sequence(n, method):