Question: PYTHON QUESTION 2. Write a function called first_day_greater that takes two lists, L1 and L2 , representing the daily measured weights of rat 1 and

PYTHON QUESTION

PYTHON QUESTION 2. Write a function called first_day_greater that takes two lists,

2. Write a function called first_day_greater that takes two lists, L1 and L2 , representing the daily measured weights of rat 1 and rat 2, respectively, and returns the index of the first day for which the weight for the fist rat is greater than the weight of the second rat.If there are no such days then the function should return -1. You may NOT assume that L1 and L2 are the same length. Use the following to test your program: 1 f name --" main ": L1- 15.1, 17.3, 12.3, 16.4 L2 = [ 15.0, 17.7, 12.5, 16.9 ] print ("Test 1: (".format( first_day_greater(L1,L2) )) L2= [ 15.6, 17.9, 18.2, 16.5, 12.7 ] print("Test 2: (".format( first_day_greater(L1,L2) )) L2 = [ 15.9, 18.8, 11.4 ] print ("Test 3: 0".format( first_day_greater(L1,L2))

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!