statements as with all compound python statementsdef consists of header line followed by block of statementsusually indented (or simple statement after the colonthe statement block becomes the function' body--that isthe code python executes each time the function is later called the def header line specifies function name that is assigned the function objectalong with list of zero or more arguments (sometimes called parametersin parentheses the argument names in the header are assigned to the objects passed in parentheses at the point of call function bodies often contain return statementdef name(arg arg argn)return value the python return statement can show up anywhere in function bodywhen reachedit ends the function call and sends result back to the caller the return statement consists of an optional object value expression that gives the function' result if the value is omittedreturn sends back none the return statement itself is optional tooif it' not presentthe function exits when the control flow falls off the end of the function body technicallya function without return statement also returns the none object automaticallybut this return value is usually ignored at the call functions may also contain yield statementswhich are designed to produce series of values over timebut we'll defer discussion of these until we survey generator topics in def executes at runtime the python def is true executable statementwhen it runsit creates new function object and assigns it to name (rememberall we have in python is runtimethere is no such thing as separate compile time because it' statementa def can appear anywhere statement can--even nested in other statements for instancealthough defs normally are run when the module enclosing them is importedit' also completely legal to nest function def inside an if statement to select between alternative definitionsif testdef func()elsedef func()func(define func this way or else this way call the version selected and built coding functions