Start learning free

LESSON 175 OF 410 · PROJECTS: EVERYDAY PROGRAMS

Report Card V6 - Class Statistics in Python

Practice

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:

  • highest is the largest value in scores.
  • lowest is the smallest value in scores.
  • average is the sum divided by the count, using integer division (//).
  • Store the three results in variables named highest, lowest and average. 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)

STEP 1 OF 3
    Ctrl + Enter to check

    Report Card V6 in Python

    Keep going with PythonAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free