[python] how to return index of a sorted list?