Sorting Using Function Pointer In Python