lambda are simple functions
code equal to
code equal to
pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')] def pair_sort(pair): return pair[1] # this point to second object in list (1, 'one')[1] == 'one' pairs.sort(key=pair_sort) print(pairs)
99 percent of computer problems exists between chair and keyboard.