[('sara', 75, 180), ('marko', 90, 190), ('jaimi', 75, 175), ('alex', 60, 175)]
I want to sort this list based on height and weight. The second element of each tuple is weight and the third is height.
Task: First sort by height (tall to short). If some element's height is equal sort that element with weight (slim to fat).
The output should be like this:
[('marko', 90, 190), ('sara', 75, 180), ('alex', 60, 175), ('jaimi', 75, 175)]
I still doing this code:
x=sorted(result,key=lambda x: (x[2],x[1]),reverse=True)