Python Sort List Using Function In Javascript Tutorial