Search
 
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
Name
2+1 =