sorted give two key python code example Example: python sort two key s = sorted(s, key = lambda x: (x[1], x[2]))