the lambda' general form is the keyword lambdafollowed by one or more arguments (exactly like the arguments list you enclose in parentheses in def header)followed by an expression after colonlambda argument argument argumentn expression using arguments function objects returned by running lambda expressions work exactly the same as those created and assigned by defsbut there are few differences that make lambdas useful in specialized roleslambda is an expressionnot statement because of thisa lambda can appear in places def is not allowed by python' syntax--inside list literal or function call' argumentsfor example with deffunctions can be referenced by name but must be created elsewhere as an expressionlambda returns value ( new functionthat can optionally be assigned name in contrastthe def statement always assigns the new function to the name in the headerinstead of returning it as result lambda' body is single expressionnot block of statements the lambda' body is similar to what you' put in def body' return statementyou simply type the result as naked expressioninstead of explicitly returning it because it is limited to an expressiona lambda is less general than def--you can only squeeze so much logic into lambda body without using statements such as if this is by designto limit program nestinglambda is designed for coding simple functionsand def handles larger tasks apart from those distinctionsdefs and lambdas do the same sort of work for instancewe've seen how to make function with def statementdef func(xyz)return func( but you can achieve the same effect with lambda expression by explicitly assigning its result to name through which you can later call the functionf lambda xyzx ( heref is assigned the function object the lambda expression createsthis is how def workstoobut its assignment is automatic defaults work on lambda argumentsjust like in defx (lambda ="fee" ="fie" ="foe" cx("wee"'weefiefoe advanced function topics