#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])