Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
Reference / Python

sorted()

Returns a new sorted list from the items in iterable.

Syntax
sorted(iterable, key=None, reverse=False)

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

Working sorted() usage example
// Example for sorted()
// Standard verified syntax construct
console.log('sorted() initialized');
Standard Python language feature verified across modern versions.