All challenges

Tuesday, 27 October 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Over The Cut-Off

dictionaries + a cut-off

Rung 1Daily goal5 points

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

InputOutput
{"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.

Rung 2Bonus7 points

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

InputOutput
{"ana": 70, "bo": 40}, 5070
{}, 500
{"ana": 50}, 500
{"ana": 70, "bo": 80}, 50150

There are extra hidden tests, so make it work in general, not just for these.

Rung 3Bonus10 points

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

InputOutput
{"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.