Question: Create a new function called midFibRatio ( n ) that returns r from simpleFibRatio ( ) if no error occurs, but returns np . nan

Create a new function called midFibRatio(n) that returns r from simpleFibRatio() if no error occurs, but returns np.nan for the error raised by simpleFibRatio(n=1)(error from Question 1.2).
Test your midFibRatio() function for n =18 and then n =1. Assign the output to q1_3. Feel free to try it for other inputs.
Examples: >>> midFibRatio(2)1.0

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 Programming Questions!