Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to sort a list of lists in reverse order using the first parameter in python

#Let's consider boxTypes is a 2D array and we want to sort it in decending order
#using the second parameter. Here is the function.

boxTypes.sort(key = lambda x : -x[1])
 
PREVIOUS NEXT
Tagged: #sort #list #lists #reverse #order #parameter #python
ADD COMMENT
Topic
Name
2+1 =