Home
/
Python 3.11
/
Built-in Functions
/
sorted
Python 3.0
Python 3.9
Python 3.11
Functions
ID
EN
…
Built-in Functions
sorted
Python 3.11
Return a new sorted list from the items in iterable.
Syntax
PYTHON
Copy
sorted(iterable, /, *, key=None, reverse=False)
See Also
functools.cmp_to_key()
sorted()
__lt__()
rich comparisons
max()
__gt__()
Sorting HOW TO