First page Back Continue Last page Overview Graphics

Reverse Sort

If the ordering shall be reversed, the third parameter reverse has to be set to True.

>>> colors

['red', 'black', 'blue', 'green', 'white', 'yellow']

>>> colors.sort(reverse=True)

>>> colors

['yellow', 'white', 'red', 'green', 'blue', 'black']

>>> colors.sort()

>>> colors

['black', 'blue', 'green', 'red', 'white', 'yellow']