Tuesday, 27 October 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Over The Cut-Off
dictionaries + a cut-off
Who is above the line
Write a function called names_over
scores is a dictionary of name to score. Return a list of the names whose score is greater than limit, in the order they appear in the dictionary. A score exactly equal to limit is not above it. An empty dictionary returns an empty list.
Examples
| Input | Output |
|---|---|
| {"ana": 70, "bo": 40}, 50 | ["ana"] |
| {}, 50 | [] |
| {"ana": 50}, 50 | [] |
| {"ana": 70, "bo": 80}, 50 | ["ana", "bo"] |
There are extra hidden tests, so make it work in general, not just for these.
Add up only those scores
Write a function called total_over
Same cut-off, but now return the total of the scores that are above limit instead of the names. If nothing is above the line, the total is 0.
Examples
| Input | Output |
|---|---|
| {"ana": 70, "bo": 40}, 50 | 70 |
| {}, 50 | 0 |
| {"ana": 50}, 50 | 0 |
| {"ana": 70, "bo": 80}, 50 | 150 |
There are extra hidden tests, so make it work in general, not just for these.
Work out the line yourself
Write a function called above_average
There is no limit this time: the cut-off is the average of all the scores, worked out with whole-number division // so any remainder is thrown away. Return the names scoring above that average, in dictionary order. With scores of 1, 2 and 6 the average is 3, so only the 6 is above it. An empty dictionary returns an empty list.
Examples
| Input | Output |
|---|---|
| {"ana": 70, "bo": 40} | ["ana"] |
| {} | [] |
| {"ana": 50} | [] |
| {"a": 1, "b": 2, "c": 6} | ["c"] |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.