🌐
W3Schools
w3schools.com › python › ref_list_reverse.asp
Python List reverse() Method
Python Certificate Python Training ... The reverse() method reverses the sorting order of the elements. ... The built-in function reversed() returns a reversed iterator object. ... If you want to use W3Schools services as an educational ...
🌐
W3Schools
w3schools.com › python › ref_func_sorted.asp
Python sorted() Function
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 are sorted numerically.
Discussions

Using sorted() to print a list in reverse alphabetical order
Can anyone help me use sorted() to print a list in reverse alphabetical order please? Here is my list: places = [‘Iceland’, ‘Japan’, ‘Manchester’, ‘Norwich’] As I understand it, the sorted() function can also accept a… More on discuss.python.org
🌐 discuss.python.org
9
0
August 10, 2021
How to use sorted () function with reverse=True.
You can refer to the documentation for other use cases but you can simply use it like sorted_list = sorted(original_list, reverse=True) More on reddit.com
🌐 r/PythonLearning
8
5
June 5, 2025
🌐
W3Schools
w3schools.com › python › ref_list_sort.asp
Python List sort() Method
Sort the list by the length of the values and reversed:
🌐
Python documentation
docs.python.org › 3 › howto › sorting.html
Sorting Techniques — Python 3.14.3 documentation
February 23, 2026 - Interestingly, that effect can be simulated without the parameter by using the builtin reversed() function twice: >>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)] >>> standard_way = sorted(data, key=itemgetter(0), reverse=True) >>> double_reversed = list(reversed(sorted(reversed(data), key=itemgetter(0)))) >>> assert standard_way == double_reversed >>> standard_way [('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]
🌐
W3Schools
w3schoolsua.github.io › python › python_lists_sort_en.html
Python Sort Lists. Lessons for beginners. W3Schools in English
Python Examples Python Compiler Python Exercises Python Quiz Python Certificate ... thislist = ["orange", "mango", "kiwi", "pineapple", "banana"] thislist.sort() print(thislist) Try it Yourself » ... thislist = ["orange", "mango", "kiwi", "pineapple", "banana"] thislist.sort(reverse = True) print(thislist) Try it Yourself »
🌐
W3Schools
w3schools.com › python › python_lists_sort.asp
Python - Sort Lists
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... thislist = ["orange", "mango", "kiwi", "pineapple", "banana"] thislist.sort() print(thislist) Try it Yourself » ... thislist = ["orange", "mango", "kiwi", "pineapple", "banana"] thislist.sort(reverse = True) print(thislist) Try it Yourself »
🌐
Programiz
programiz.com › python-programming › methods › built-in › sorted
Python sorted()
# sort the vowels print('Sorted Vowels:', sorted(vowels_list)) # Output: Sorted Vowels: ['a', 'e', 'i', 'o', 'u'] ... We can use an optional reverse parameter to sort the list in descending order.
🌐
freeCodeCamp
freecodecamp.org › news › python-sort-lists-and-reverse-arrays
Python Sorted List – And How to Sort or Reverse an Array in Python
February 24, 2023 - You can sort a list in either ascending or descending order using the reverse parameter. ... # Creating a list of numbers nums = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5] # Creating a new sorted list sorted_nums = sorted(nums) print(sorted_nums) ...
Find elsewhere
🌐
Python.org
discuss.python.org › python help
Using sorted() to print a list in reverse alphabetical order - Python Help - Discussions on Python.org
August 10, 2021 - Can anyone help me use sorted() to print a list in reverse alphabetical order please? Here is my list: places = [‘Iceland’, ‘Japan’, ‘Manchester’, ‘Norwich’] As I understand it, the sorted() function can also accept a…
🌐
Real Python
realpython.com › python-sort
How to Use sorted() and .sort() in Python – Real Python
February 24, 2025 - You sort items in descending order by setting the reverse argument to True. The key argument accepts a function to customize the sort order. In this tutorial, you’ll learn how to sort various types of data in different data structures, customize ...
🌐
Python W3schools
pythonw3schools.com › home › python sorted reverse
Python Sorted Reverse - Python W3schools
March 25, 2023 - We then used the sorted() function to sort the characters in the string in reverse order by passing reverse=True as an argument. The sorted characters are then concatenated using the join() function to create a reversed string. The reversed string is stored in the variable reversed_string, ...
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python sort list in reverse order
Python Sort List in Reverse Order - Spark By {Examples}
May 31, 2024 - How to sort a list in reverse order in Python? In Python, you can use the sorted() function to sort a list in reverse order. The sorted() function returns a new sorted list without modifying the original list.
🌐
Programiz
programiz.com › python-programming › methods › list › sort
Python List sort()
Become a certified Python programmer. Try Programiz PRO! ... The list's sort() method sorts the elements of a list. ... # sort the list in ascending order prime_numbers.sort() print(prime_numbers) # Output: [2, 3, 5, 7, 11] ... We can sort a list in descending order by setting reverse to True.
🌐
W3Schools Blog
w3schools.blog › home › reverse array python
reverse array python - W3schools
July 1, 2022 - # method 1 arr = [11, 22, 33, 44, 55] res = arr[::-1] print("Reversed array:",res) #Reversed array: [5, 4, 3, 2, 1] #method 2 arr = [11, 22, 33, 44, 55] arr.reverse() print("After reversing Array:",arr) #After reversing Array: [55, 44, 33, 22, 11] #method 3 arr = [12, 34, 56, 78] result=list(reversed(arr)) print("Resultant new reversed Array:",result) #Resultant new reversed Array: [78, 56, 34, 12]
🌐
OpenStax
openstax.org › books › introduction-python-programming › pages › 9-2-sorting-and-reversing-lists
9.2 Sorting and reversing lists - Introduction to Python Programming | OpenStax
March 13, 2024 - For strings, ASCII values are used ... ascending order but so is "G"; thus, "Gail" comes before "apple". The reverse() method reverses the elements in a list....
🌐
Cach3
w3schools.com.cach3.com › python › ref_func_sorted.asp.html
Python sorted() Function - W3Schools
Python Examples Python Exercises Python Quiz Python Certificate ... 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 are sorted numerically. Note: You cannot sort a list that contains BOTH string values AND numeric values. ... a = ("h", "b", "a", "c", "f", "d", "e", "g") x = sorted(a, reverse=True) print(x) Try it Yourself »