Objective
Create a Python program with a function that has type annotations and returns a dictionary with several statistics.
Instructions
- Define
def statistics(numbers: list[int]) -> dict[str, int], which returns a dictionary with the keys"min","max"and"sum". - Read a line with integers separated by spaces (at least one).
- Show
Minimum: X,Maximum: YandSum: Son three lines.
4 8 15 16 23 42
Minimum: 4
Maximum: 42
Sum: 108
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise