Tuples and sets · 7 / 16 Exercise Easy

Minimum and maximum with a tuple

Objective

Create a Python program with a function that returns the minimum and the maximum of a list of numbers at once.

Instructions

  • Define the function min_max(numbers), which returns a tuple (minimum, maximum).
  • Read 5 integers and store them in a list.
  • Call the function and unpack the result into two variables.
  • Show Minimum: A on the first line and Maximum: B on the second.
Input
4
9
1
7
3
Output
Minimum: 1
Maximum: 9

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise