Question: Plese write the python code ,and explain step by step.Thanks in advance! Each new term in the Fibonacci sequence is generated by adding the previous
Plese write the python code ,and explain step by step.Thanks in advance!
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 0 and 1, the first 10 terms will be:
0,1,1,2,3,5,8,13,21,34,...
Notice that some terms are even, and some are odd. Implement a function n even fibonacci(n) that takes an integer n as input,
and returns a list of the first n even fibonacci terms, in ascending order. You will need to write the function definition yourself.
Example: calling n even fibonacci(10) should return [0, 2, 8, 34, 144, 610, 2584, 10946, 46368, 196418].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
