python - Sort a list of tuples depending on two elements - Stack Overflow

PHOTO EMBED

Sun Dec 19 2021 05:36:33 GMT+0000 (Coordinated Universal Time)

Saved by @tharindu #python

sorted(unsorted, key=lambda element: (element[1], element[2]))
content_copyCOPY

https://stackoverflow.com/questions/9376384/sort-a-list-of-tuples-depending-on-two-elements/9376419#9376419