About 1,690,000 results
Open links in new tab
  1. sort() in Python - GeeksforGeeks

    May 5, 2025 · a.sort(reverse=True) sorts a in descending order. Syntax of sort() list.sort(reverse=False, key=None, m=None) Parameters: reverse (optional): If True, sorts in …

  2. Python Sort List – How to Order By Descending or Ascending

    Sep 3, 2021 · In Python, you can sort data by using the sorted() method or sort() method. In this article, I will provide code examples for the sorted() and sort() methods and explain the …

  3. Python list sort in descending order - Stack Overflow

    Mar 16, 2023 · Since your list is already in ascending order, we can simply reverse the list. Here is another way. Especially if the data is numeric, negation can be used to sort in descending …

  4. Sorting Techniques — Python 3.13.3 documentation

    1 day ago · Both list.sort() and sorted() accept a reverse parameter with a boolean value. This is used to flag descending sorts. For example, to get the student data in reverse age order: Sorts …

  5. 5 Ways to Sort a Python List in Descending Order - TechBeamers

    Feb 10, 2024 · The sorted() function is a built-in Python function that can be used to sort any iterable, including lists. When applied to a list, sorted() returns a new list with elements sorted …

  6. Python Sort List in Descending Order - CodeRivers

    Apr 6, 2025 · To sort a list in descending order, we can use the reverse parameter. iterable: The list or other iterable object that you want to sort. key: An optional function that serves as a key …

  7. How to Sort a List in Descending Order in Python - Python

    To sort a list in descending order in Python, call sort () method on the list object, and specify the named argument reverse=True. By default sort () method of a list instance sorts the list in …

  8. Python Descending Sort: A Comprehensive Guide - CodeRivers

    Mar 19, 2025 · To sort a list in descending order, you can use the sort() method or the sorted() function. Using the sort() method: In this example, the sort() method modifies the original list in …

  9. Python List sort() Method - GeeksforGeeks

    Nov 7, 2024 · Use reverse=True to sort in descending order. The key parameter can be used for customizing the sorting logic. We can use sorted () method, if we need to create a new sorted …

  10. Sorting Algorithms in Python - GeeksforGeeks

    Apr 9, 2025 · Decreasing Order: A set of values are said to be in decreasing order when the successive element is always less than the previous one. For Example: 5, 4, 3, 2, 1. Here the …

  11. Some results have been removed
Refresh