Command Palette

Search for a command to run...

Hectal
Phase 4: Lists, Tuples, Dictionaries and Sets
Python · Exercise 2 of 6 PreviousNext
Beginner

Rank the scores

scores is [72, 95, 88, 61, 79]. Do not change it.

Make top_three: the three highest scores, highest first. Make lowest (the smallest score) and average (the sum divided by how many there are).

Print Top three: [95, 88, 79] using top_three.

What Check tests

  1. top_three is [95, 88, 79]
  2. scores is unchanged
  3. top_three is a new list, not scores itself
  4. lowest is 61
  5. average is 79.0
  6. The program prints Top three: [95, 88, 79]

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.