DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python sort list of tuples lexicographically
sorted_by_length = sorted(list_, key=lambda x: (x[0], len(x[1]), float(x[1])))
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#sort
#list
#tuples
#lexicographically
ADD COMMENT
Topic
COMMENT
Name
2+1 =
Submit