how to sort list of lists by second element python code example Example: sorting by second element sorted(LISTNAME, key=lambda x: x[1])