sorted in python with key with 2 values code example Example: python sort multiple keys records.sort( key = lambda l: (l[0], l[2]) )