Question: I need help with python code. Construct a function called 'buildFab' which constructs and returns a list of Fabinocci sequence. The function will build the
I need help with python code.

Construct a function called 'buildFab' which constructs and returns a list of Fabinocci sequence. The function will build the sequence with the total numbers generated is equal to the received function argument. So if the function is called with 3 as the argument; buildFab(3) then it returns [1,2,3] as the sequence If the given argument is 10; buildFab(10) then it returns [1,2,3,5,8,13, 21, 34, 55, 89] Your function should work for any given argument other than a negative number. If a negative number is given, it should return a message 'cannot generate sequence for negative numbers [] 1 # Your solution below [ 1 assert (buildFab(10) == [1, 2, 3, 5, 8, 13, 21, 34, 55, 89]) 2 assert ( buildFab(-3) == 'cannot generate sequence for negative numbers') 3 print("Test Passed") --------------------------------------------------------------------------- NameError Traceback (most recent call last)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
