Podium Finishers with Medals

Medium ⏱ 12 min 49% acceptance ★★★★★ 4.6
Write podium(finishers) that takes an ordered list of runner names and returns the first three paired with 'gold', 'silver', 'bronze' as tuples. If fewer than three finished, pair only as many as exist — a comprehension over zip handles this naturally.

Examples

Example 1
Input
podium(['Asha', 'Ben'])
Output
[('Asha', 'gold'), ('Ben', 'silver')]
Explanation

zip stops at the shorter sequence.

Constraints

  • At most three tuples.
  • Use zip with the medal list.

Topics

List Comprehensionszip + slicing

Companies

NikeAdidasDecathlon

Hints

Hint 1

Medals list: ['gold', 'silver', 'bronze'].

Hint 2

zip truncates to the shorter iterable automatically.

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.