Python · Function
range
sorted() returns a new list with the items from an iterable in sorted order. Use key to control comparisons and reverse=True for descending order.
Last updated
Syntax
sorted(iterable, /, *, key=None, reverse=False)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
list.sortreversedkey