Returning the maximum and the minimum together
Write code · Medium · §7.3, §8.4 Returning several values
Complete the function find_max_min, which takes a list of numbers and returns the tuple (maximum, minimum). Do not use max() or min(). For [10, 55, 8, 99, 2, 37], it returns (99, 2).
Starter code
def find_max_min(nums):
# Write your code here
pass
print(find_max_min([10, 55, 8, 99, 2, 37]))Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.