All challenges

Saturday, 24 October 2026

Past

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

Three Numbers

comparing three values

Rung 1Daily goal5 points

The biggest of three

Write a function called biggest

Return the largest of the three numbers. Two or all three may be equal, and that is fine — the largest value is still just that value.

Examples

InputOutput
1, 2, 33
5, 5, 15
-1, -2, -3-1
0, 0, 00

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

Rung 2Bonus7 points

The one in the middle

Write a function called middle

Return the number that sits between the other two, so 3, 1, 2 gives 2. When values are equal the middle one is still whichever value ends up in the middle once they are in order: 5, 5, 1 gives 5. Neat route: add all three up, then take away the biggest and the smallest.

Examples

InputOutput
1, 2, 32
3, 1, 22
5, 5, 15
0, 0, 00

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

Rung 3Bonus10 points

Put them in order

Write a function called order_three

Return a list holding all three numbers, smallest first and largest last, so 3, 1, 2 gives [1, 2, 3]. Equal values simply sit next to each other, so 5, 5, 1 gives [1, 5, 5]. The list always has exactly three numbers in it.

Examples

InputOutput
3, 1, 2[1, 2, 3]
1, 2, 3[1, 2, 3]
5, 5, 1[1, 5, 5]
0, 0, 0[0, 0, 0]

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.