All 3 tests pass. The bug was in `median`: it indexed into the raw input without sorting, so `[9, 1, 5]` returned `1` and `[10, 2, 8, 4]` returned `5.0`. It now sorts a copy (leaving the caller's list untouched) and raises `ValueError` on empty input rather than throwing an `IndexError`. `test_calc.py` was not modified.

DONE