The Runner-Up

Python FundamentalsMedium+10 XP+10

The Runner-Up

A game's results screen shows the second-highest score.

Task: write runner_up(scores) that returns the second-highest value in scores.

  • Repeated scores count separately: in [50, 80, 80] the two 80s are first and second, so the answer is 80.
  • scores always has at least two values.

Examples

scores = [42, 17, 88, 63]
returns 63
scores = [50, 80, 80]
returns 80

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