Question: Python 3.7.2 1. Consider the following Python program: def mysteryl(vals): takes a list of numbers and does something with them scored_vals[[x**2, x] for x

Python 3.7.2
1. Consider the following Python program: def mysteryl(vals): takes a list of numbers and does something with them """ scored_vals[[x**2, x] for x in vals] best_pair-max(scored_vals) return best pair[1] print (mysteryl([-2, 1, 3, -4])) In section 1-1 of ps3pr01, we have given you a table that you should complete to illustrate the execution of the list comprehension during the call to mystery1 in the program above. In the column for scored vals, you should show the how the result of the list comprehension is gradually built up. In other words, for each new value of the list comprehension's "runner" variable x, you should show the current partial result of the list comprehension. You may not need all of the rows provided in the tables, but please do not remove or add any rows. 2. What value is assigned to the variable bestpair during the call to mysteryl in the program above? Put your answer in the box provided. 3. What value is returned by the call to mystery1 in the program above? Put your answer in the box provided. 1. Consider the following Python program: def mysteryl(vals): takes a list of numbers and does something with them """ scored_vals[[x**2, x] for x in vals] best_pair-max(scored_vals) return best pair[1] print (mysteryl([-2, 1, 3, -4])) In section 1-1 of ps3pr01, we have given you a table that you should complete to illustrate the execution of the list comprehension during the call to mystery1 in the program above. In the column for scored vals, you should show the how the result of the list comprehension is gradually built up. In other words, for each new value of the list comprehension's "runner" variable x, you should show the current partial result of the list comprehension. You may not need all of the rows provided in the tables, but please do not remove or add any rows. 2. What value is assigned to the variable bestpair during the call to mysteryl in the program above? Put your answer in the box provided. 3. What value is returned by the call to mystery1 in the program above? Put your answer in the box provided
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
