This will give you a sorted version of the array.
Copysorted(timestamps, reverse=True)
If you want to sort in-place:
Copytimestamps.sort(reverse=True)
Check the docs at Sorting HOW TO
Answer from Marcelo Cantos on Stack OverflowPython documentation
docs.python.org › 3 › howto › sorting.html
Sorting Techniques — Python 3.14.6 documentation
Both list.sort() and sorted() accept a reverse parameter with a boolean value. This is used to flag descending sorts.
Top answer 1 of 7
605
This will give you a sorted version of the array.
Copysorted(timestamps, reverse=True)
If you want to sort in-place:
Copytimestamps.sort(reverse=True)
Check the docs at Sorting HOW TO
2 of 7
430
In one line, using a lambda:
Copytimestamps.sort(key=lambda x: time.strptime(x, '%Y-%m-%d %H:%M:%S')[0:6], reverse=True)
Passing a function to list.sort:
Copydef foo(x):
return time.strptime(x, '%Y-%m-%d %H:%M:%S')[0:6]
timestamps.sort(key=foo, reverse=True)
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
Show HN: CLI to order groceries via reverse-engineered REWE API (Haskell)
And then 2026 feels like the perfect time writing Haskell. The code is handwritten, but whenever I got stuck with the build system or was just not getting the types right, I could fall back to ask AI to unblock me. It was never that smooth before · Finally the best side projects are the ones ... More on news.ycombinator.com
Videos
03:59
Python list sort, sorted, and reverse (CS105 at UIUC) - YouTube
07:09
Sorting and Reversing a list| Python for Beginners | Module 03 ...
10:06
How to Order Lists in Python (Visually Explained) | sort(), sorted(), ...
01:58
Python Programming 29 - Sort Data in Reverse Order - YouTube
00:50
How to Sort a List in Python | Amit Thinks
Reddit
reddit.com › r/pythonlearning › how to use sorted () function with reverse=true.
r/PythonLearning on Reddit: How to use sorted () function with reverse=True.
June 5, 2025 -
I'm learning python on my own and got the "Python Crash Course" book and I'm stuck on trying to sort a list in reverse using the sorted () function.
W3Schools
w3schools.com › python › ref_func_sorted.asp
Python sorted() Function
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training ... 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 »
Programiz
programiz.com › python-programming › methods › built-in › sorted
Python sorted()
Here, sorted(iterable, reverse = True) sorts the list in descending order. The sorted() method accepts another optional parameter- the key function. For example, ... Here, len is Python's built-in function that counts the length of an element.
Programiz
programiz.com › python-programming › methods › list › sort
Python List sort()
cities = ["Tokyo", "London", "Washington D.C"] # sort in dictionary order cities.sort() print(f"Dictionary order: {cities}") # sort in reverse dictionary order cities.sort(reverse = True) print(f"Reverse dictionary order: {cities}")
Mimo
mimo.org › glossary › python › list-sort()
Python List sort(): Master Data Sorting | Learn Now
You can sort the list in descending order by passing reverse=True as an argument: ... This method sorts the list based on the specified sorting criteria, making it one of Python's most commonly used features for data organization.
Processing
py.processing.org › reference › sorted
sorted() \ Language (API)
Python Mode for Processing extends the Processing Development Environment with the Python programming language.
Wikipedia
en.wikipedia.org › wiki › Reverse_Polish_notation
Reverse Polish notation - Wikipedia
2 weeks ago - During the 1970s and 1980s, Hewlett-Packard used RPN in all of their desktop and hand-held calculators, and has continued to use it in some models into the 2020s. In computer science, reverse Polish notation is used in stack-oriented programming languages such as Forth, dc, Factor, STOIC, PostScript, RPL, and Joy.
Hacker News
news.ycombinator.com › item
Show HN: CLI to order groceries via reverse-engineered REWE API (Haskell) | Hacker News
April 4, 2026 - And then 2026 feels like the perfect time writing Haskell. The code is handwritten, but whenever I got stuck with the build system or was just not getting the types right, I could fall back to ask AI to unblock me. It was never that smooth before · Finally the best side projects are the ones ...
Facebook
facebook.com › groups › photoshopthat › posts › 1137611728913713
Identify snake in west Tennessee picture
We cannot provide a description for this page right now
AlgoExpert
algoexpert.io › questions
AlgoExpert | Ace the Coding Interviews
The leading platform to prepare for coding interviews. Master essential algorithms and data structures, and land your dream job with AlgoExpert.
W3Schools
w3schools.com › python › python_lists_sort.asp
Python - Sort Lists
The reverse() method reverses the current sorting order of the elements.