Question: PYTHON: Create a function (jumpMaximum) that, given any list of integers list, returns a list with the same elements as list, except that the first
PYTHON: Create a function (jumpMaximum) that, given any list of integers list, returns a list with the same elements as list, except that the first element has been swapped with the maximum element in list.
Note: This function should not print the list, but return it.
Example output for list= [1,2,3,4]:
>>> jumpMaximum([1,2,3,4])
[4,2,3,1]
Example output for list = [5,8,3,21,7,4,14]:
>>> jumpMaximum([5,8,3,21,7,4,14])
[21,8,3,5,7,4,14]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
