Compute three class statistics from a list of scores: the highest, the lowest, and the average.
You start with:
scores = [92, 78, 85, 67, 74, 88, 91, 58]
Build:
Highest: 92 Lowest: 58 Average: 79
Rules:
highestis the largest value inscores.lowestis the smallest value inscores.averageis the sum divided by the count, using integer division (//).- Store the three results in variables named
highest,lowestandaverage. The checker prints the three lines for you, so do not print anything yourself.
Use
max(scores), min(scores), and sum(scores) // len(scores).
scores = [92, 78, 85, 67, 74, 88, 91, 58]
highest = max(scores)
lowest = min(scores)
average = sum(scores) // len(scores)
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check
