#code for sorting big integers
lis = ['234', '5', '2', '12435645758']
lis.sort(key = lambda x: len(x))
print lis
#output ['5', '2', '234', '12435645758']
lis.sort(key = lambda x: (len(x), x))
print lis
#output ['2', '5', '234', '12435645758']
Am trying to sort big number strings in Python without converting the strings to integers and couldn't understand how these lambda expression are evaluated.
The first lambda expression is sorting based on length of string and sorting the list, but what does the second one do? I would like to know how the second lambda expression is evaluated.