top of page


2026-06-30
When sorting gets hilariously broken
To all tech people: How can you actually sort a list by only the first letter of the string and then leave the rest completely random? 🧐
I mean, it's not even a lazy mistake. It seems significantly more complex than just sorting by country name ALPHABETICALLY, right? 😅
Hey Dun & Bradstreet Europe, you might wanna put this in your Backlog 😬

3

16
View on



TOP COMMENTS
My guess is that it's not actually sorting alphabetically on the name. It's sorting on some other field, or not having a sort applied, and that's the order you're seeing.
Nina
my_list = ["banana", "apple", "avocado", "blueberry", "cherry"]
sorted_list = sorted(my_list, key=lambda x: x[0])
print(sorted_list)
Werner
bottom of page

