because it is statementnot an expression the equivalent def coding would require temporary function names (which might clash with othersand function definitions outside the context of intended use (which might be hundreds of lines away)def ( )return * def ( )return * def ( )return * define named functions [ reference by name for in lprint( ( )prints print( [ ]( )prints multiway branch switchesthe finale in factyou can do the same sort of thing with dictionaries and other data structures in python to build up more general sorts of action tables here' another example to illustrateat the interactive promptkey 'got{'already'(lambda )'got'(lambda )'one'(lambda * )}[key]( herewhen python makes the temporary dictionaryeach of the nested lambdas generates and leaves behind function to be called later indexing by key fetches one of those functionsand parentheses force the fetched function to be called when coded this waya dictionary becomes more general multiway branching tool than what could fully show you in ' coverage of if statements to make this work without lambdayou' need to instead code three def statements somewhere else in your fileoutside the dictionary in which the functions are to be usedand reference the functions by namedef ()return def ()return def ()return * key 'one{'already' 'got' 'one' }[key]( this workstoobut your defs may be arbitrarily far away in your fileeven if they are just little bits of code the code proximity that lambdas provide is especially useful for functions that will only be used in single context--if the three functions here are not useful anywhere elseit makes sense to embed their definitions within the dictionary advanced function topics