Editor

Marks on One Line

Programs with input · Intermediate · about 8 min

Read a list of marks typed on one line and separated by spaces: whole numbers, at least one of them. Print the highest mark, the lowest, the average rounded to 2 decimal places, and how many marks are above the average, each on its own line as shown below.

The prompts inside input() are not checked, only what you print.

Example

You type:

70 95 40 80

The program prints:

Highest: 95
Lowest: 40
Average: 71.25
Above average: 2
line = input("Marks: ")
# Turn the line into a list of numbers, then print the four results
The solution opens after your first Check.