functions and scoping we've already used number of built-in functionse max and abs in figure the ability for programmers to define and then use their own functionsas if they were built-inis qualitative leap forward in convenience function definitions in python each function definition is of the form def name of function (list of formal parameters)body of function for examplewe could define the function max by the code def max(xy)if yreturn elsereturn def is reserved word that tells python that function is about to be defined the function name (max in this exampleis simply name that is used to refer to the function the sequence of names ( , in this examplewithin the parentheses following the function name are the formal parameters of the function when the function is usedthe formal parameters are bound (as in an assignment statementto the actual parameters (often referred to as argumentsof the function invocation (also referred to as function callfor examplethe invocation max( binds to and to the function body is any piece of python code there ishowevera special statementreturnthat can be used only within the body of function function call is an expressionand like all expressions it has value that value is the value returned by the invoked function for examplethe value of the expression max( , )*max( , is because the first invocation of max returns the int and the second returns the int note that execution of return statement terminates that invocation of the function to recapitulatewhen function is called the expressions that make up the actual parameters are evaluatedand the formal parameters of the function are bound to the resulting values for examplethe invocation max( + zwill bind the formal parameter to and the formal parameter to whatever value the variable has when the invocation is evaluated recall that italics is used to describe python code in practiceyou would probably use the built-in function maxrather than define your own