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.

I need help with python code. Construct a function called 'buildFab' which

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) in () ----> 1 assert (buildFab(10) == [1, 2, 3, 5, 8, 13, 21, 34, 55, 89]) 2 print("Test Passed") NameError: name 'buildFab' is not defined

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!