Python problem solves mean/median