Question: For Python 3 You will write two functions. Write one function that takes a list of numbers as an argument and returns the maximum (largest)
For Python 3
You will write two functions.
Write one function that takes a list of numbers as an argument and returns the maximum (largest) number in the list.
Write another function that takes a list of numbers as an argument and returns the minimum of the list.
Do not use built-in functions max, min, or any function that sorts the list. Invoke/call both functions with the list [0, 3.14159, 5, 1, 9, 2.71828, -1]. Print the results. Your functions should work with lists of any size.
HINT: Set the max/min to the first element of the list and use a loop to iterate through the rest of the list checking if the value is larger/smaller than the max/min.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
