About 3,740,000 results
Open links in new tab
  1. How to Sort a Set of Values in Python? - GeeksforGeeks

    Apr 4, 2025 · This example demonstrates how to use the reverse=True parameter to sort data in descending order, along with the regular sorted() function. Python a = [ "geeks" , "for" , "geeks" …

  2. python - Sorting a set of values - Stack Overflow

    Jul 3, 2013 · I want to sort each set. That's easy. For any set s (or anything else iterable), sorted(s) returns a list of the elements of s in sorted order: >>> s = set(['0.000000000', …

  3. Python list sort in descending order - Stack Overflow

    Mar 16, 2023 · How can I sort this list in descending order? timestamps = [ "2010-04-20 10:07:30", "2010-04-20 10:07:38", "2010-04-20 10:07:52", "2010-04-20 10:0...

  4. How to Sort a Set in Python - Delft Stack

    Feb 2, 2024 · To sort a set using the sort() method, you must first convert the set to a list. This method allows you to sort the list in ascending or descending order, as well as apply custom …

  5. Python List sort() Method - GeeksforGeeks

    Nov 7, 2024 · The sort () method in Python is a built-in function that allows us to sort the elements of a list in ascending or descending order and it modifies the list in place which means there is …

  6. Sort Set of Values in Python - Spark By Examples

    May 30, 2024 · Can I sort a set in descending order? You can sort a set in descending order by using the sorted() function with the reverse=True argument. This argument reverses the …

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

    Sep 3, 2021 · In this example, we have a list of numbers sorted in descending order. reverse=True tells the computer to reverse the list from largest to smallest. Another key …

  8. Sort a Set in Python - SkillSugar

    Mar 7, 2022 · To sort a Python set, use either the sorted() or sort() function. In this tutorial, we will go through examples of how to use both of these functions. Here is the syntax of the Python …

  9. PYTHON - SORT SET ELEMENTS - learnerslesson.com

    How to sort a Set in Ascending/Descending Order? The 'sorted ( )' Function is used to sort a Set in Ascending/Descending order. At first let us see an example to sort a Set in Ascending order. …

  10. Sorting in Descending Order in Python - CodeRivers

    Mar 28, 2025 · In Python, sorting data in descending order is a common task, whether you are dealing with lists of numbers, strings, or custom objects. Understanding how to sort in …

Refresh