how to sort a nested list in reverse order of second element code example Example: sorting by second element sorted(LISTNAME, key=lambda x: x[1])