sort based on two keys python code example
Example 1: python sort multiple keys
records.sort(
key = lambda l: (l[0], l[2])
)
Example 2: python sort two key
s = sorted(s, key = lambda x: (x[1], x[2]))
records.sort(
key = lambda l: (l[0], l[2])
)
s = sorted(s, key = lambda x: (x[1], x[2]))