List sort by multiple list value

Hi
I’m trying to sort list by multiple value at the same time. I have a list of list that contains elements and its parameters. Than I would like to sort list by width and hights value at the same time. Please help:)

First element to sort is at 3 postion on a list and second position to sort is on 4 position.

Hi @RobertSendkowski;

Just your python code is correct, just sort it again by position 4.

just add the ff line after line 11:

output1 = sorted(output, keys=lambda x:x[4])

and then

OUT = output1

take a look at this:


maybe it will help

Thanks a lot, it works:)