Deviopath › Python

Min and Max Together

Easy · Tuples

A function can return several values at once as a tuple: return a, b. The caller can unpack it with low, high = min_max(nums).

Write a function min_max(numbers) that returns a tuple (smallest, largest) for a non-empty list.

Next: Stock Lookup