The Honour Roll

Python for AIHard+10 XP+10

The Honour Roll

A school exported its results as text rows like "Ada,91": a name, a comma, then a whole-number score.

Write honour_roll(rows, pass_mark). It returns the names of students who scored at least pass_mark, ordered from the highest score to the lowest.

  • Students with the same score keep the order they had in rows.
  • No rows, or nobody passing, gives back an empty list.

This one is easy to cram into a single unreadable line. Give each step its own named line instead.

Examples

rows = ["Ada,91", "Ben,45", "Cleo,78"]
pass_mark = 50
returns ['Ada', 'Cleo']
rows = []
pass_mark = 50
returns []

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run