Closed bhargavvader closed 10 years ago
The functionality was changed in Python3. https://docs.python.org/3/library/stdtypes.html#list.sort https://docs.python.org/3/library/functools.html#functools.cmp_to_key
def foo(x): return -x sorted([100, 1, 0, 22, 33, 5, 55], key=foo)
should sort the array in descending order but the output is different
Expected output: [ 100, 55, 33, 22, 5, 1, 0 ] Actual output: [ 100, 1, 0, 22, 33, 5, 55 ]
I think this is a dupe of #38, but please reopen if that is incorrect.
The functionality was changed in Python3. https://docs.python.org/3/library/stdtypes.html#list.sort https://docs.python.org/3/library/functools.html#functools.cmp_to_key
should sort the array in descending order but the output is different