Geeksforgeeks Javascript Array Sort Method In Python