Dec-10-2017, 06:33 AM
lambda pair: pair[1]lambda is called an anonymous function. The argument is passed before the ":". The expression which returns some value is after the colons. In this case, this is pair[1] which points to the second element of an iterable. So the list will be sorted by the second element of the tuples.