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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started