About 319,000 results
Open links in new tab
  1. Sorting Techniques — Python 3.14.2 documentation

    1 day ago · Python lists have a built-in list.sort() method that modifies the list in-place. There is also a sorted() built-in function that builds a new sorted list from an iterable.

  2. How to Use sorted () and .sort () in Python – Real Python

    Feb 24, 2025 · In this tutorial, you’ll learn how to sort various types of data in different data structures, customize the order, and work with two different ways of sorting in Python.

  3. Python sorted () Function - W3Schools

    Definition and Usage The sorted() function returns a sorted list of the specified iterable object. You can specify ascending or descending order. Strings are sorted alphabetically, and numbers …

  4. Python sorted () Function - GeeksforGeeks

    Dec 20, 2025 · sorted () function in Python returns a new sorted list from the elements of any iterable, such as a list, tuple, set, or string. It does not modify the original iterable, unlike the …

  5. Python sorted Function - Complete Guide - ZetCode

    Apr 11, 2025 · This comprehensive guide explores Python's sorted function, which returns a new sorted list from items in an iterable. We'll cover basic usage, custom sorting, and practical …

  6. sorted — Python Function Reference

    Find out how the sorted function works in Python. Return a new sorted list from the items in iterable.

  7. sorted () builtin function - Python Examples

    Python sorted () built-in function sorts items of any iterable passed to it and returns sorted items in a list. In this tutorial, we will learn the syntax of sorted () function, how to use it to sort items in …

  8. Python sorted

    Use the sorted() function to return a new sorted list from a list. Use the sorted() function with the reverse argument sets to True to sort a list in the reverse sort order.

  9. How to sort a list in Python - Codecademy

    Learn how to sort lists in Python using `.sort()` and `sorted()`. Explore custom sorting with keys, descending order sorting, and apply real-world sorting techniques efficiently.

  10. Python sorted () - Programiz

    The sorted() method sorts the elements of the given iterable in ascending order and returns it. Here, we created a new list to store the sorted list. This is because sorted() doesn't sort the …