Question: Define the get_most_recent0 function which is passed two lists of numbers as parameters: a list of numbers which are in order from the least recent


Define the get_most_recent0 function which is passed two lists of numbers as parameters: a list of numbers which are in order from the least recent to the most recent, i.e., the number at the end of the list is the most recent, and . a list of numbers to test the numbers of this list may or may not be elements of the first parameter list. This function returns the number from the "list of numbers to test" which occurred most recently in the first parameter list (i.e., is closer to the end of the list). If none of the numbers in the "numbers to test-list occurred in the first parameter list, the function should return -1. For example, the following code: print("1.", get_most_recent([O, 1, 2, 0, 3, 4, 1], [2, 0, 3])) print("2.", get_most_recent([O, 1, 2, 0, 3, 4, 1], [0, 7, 2])) print("3.", get_most_recent([O, 1, 2, 8, 9, 0, 3, 4, 6], [1, 9, 2, 8])) print("4.", get_most_recent(C4, 1, 4, 5, 4, 1], [O, 7, 3]) print("5.", get_most_recent([8, 1, 2, 0, 8, 4, 1], [8, 7, 3])) print("6.", get_most_recent(], 8, 1, 0, 3])) numbers_in_order [1, 1, 1, 0, 1, 0, 2, 2, 1, 2, 0, 1, 2, 0, 3, 4, 1, 2, 4, 0, 3, 8, 8, 5, 5] print("7.", get most_recent (numbers in_order, [1, 0, 3, 4] numbers_in_order [1, 2, 2, 2, 2, 3, 1, 3, 8, 0] print("8.", get_most_recent(numbers_in_order, [1, 8, 2, 3, 4, 2])) prints 2. 0 3. 9 5. 8 7. 3 8. 8 Answer: (penalty regime: 0 %)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
