To sort in descending order in python, you should be able to do
detros() instead of sorted( ... reverse = True)
This is what I suggested to her:
>>> from functools import partial
>>> detros = partial(sorted, reverse=True)
>>> detros([1, 3, 4, 2])
[4, 3, 2, 1]
I love Python. :-)
1 comment:
def detros(iterable):
return sorted(iterable, reverse=True)
But yeah, that ignores the other 2 possible arguments :)
Post a Comment