'georgia''florida''south carolina''west virginia'anonymous (lambdafunctions python has support for so-called anonymous or lambda functionswhich are really just simple functions consisting of single statementthe result of which is the return value they are defined using the lambda keywordwhich has no meaning other than "we are declaring an anonymous function def short_function( )return equiv_anon lambda xx usually refer to these as lambda functions in the rest of the book they are especially convenient in data analysis becauseas you'll seethere are many cases where data transformation functions will take functions as arguments it' often less typing (and clearerto pass lambda function as opposed to writing full-out function declaration or even assigning the lambda function to local variable for exampleconsider this silly exampledef apply_to_list(some_listf)return [ (xfor in some_listints [ apply_to_list(intslambda xx you could also have written [ for in ints]but here we were able to succintly pass custom operator to the apply_to_list function as another examplesuppose you wanted to sort collection of strings by the number of distinct letters in each stringin [ ]strings ['foo''card''bar''aaaa''abab'here we could pass lambda function to the list' sort methodin [ ]strings sort(key=lambda xlen(set(list( )))in [ ]strings out[ ]['aaaa''foo''abab''bar''card'one reason lambda functions are called anonymous functions is that the function object itself is never given name attribute appendixpython language essentials www it-ebooks info