Drop the Warm-Up and Cool-Down

Python FundamentalsMedium+10 XP+10

Drop the Warm-Up and Cool-Down

A runner's lap times are stored in a list. The first lap is a warm-up and the last lap is a cool-down, so the coach ignores both.

Task: write middle_laps(lap_times) that returns a new list of every lap except the first and the last.

  • lap_times always has at least two values. With exactly two, nothing is left, so return an empty list.

Examples

lap_times = [95, 82, 80, 81, 99]
returns [82, 80, 81]
lap_times = [70, 64, 90]
returns [64]

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