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