ID EN
Built-in Types

sort

Python 3.11

This method sorts the list in place, using only < comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state).

Syntax

PYTHON
sort(*, key=None, reverse=False)

See Also

sort() keyword-only arguments functools.cmp_to_key() sorted() sort() Sorting HOW TO ValueError