Question: Implement using python: function max_val(lst), which returns the maximum value of the elements in the list. For example, given a list lst: [-19, -3, 20,

Implement using python: function max_val(lst), which returns the maximum value of the elements in the list. For example, given a list lst: [-19, -3, 20, -1, 5, -25], the function should return 20. The name of the method should be max_val and the method should take one parameter which is the list of values to test. Here is an example call to the function print(max_val([-19, -3, 20, -1, 5, -25]))

Note: You do not need any other code in the main method or any print statements. ONLY the max_val method is required. Otherwise, the autograder will fail and be unable to grade your code. (I.e., do not include the above example in your code.) The above example should be used to test your code but deleted or commented out upon submission.

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!