both reduce the amount of code we need to write and increase our code' flexibility local variables probably the most interesting part of this examplethoughis its names it turns out that the variable res inside intersect is what in python is called local variable-- name that is visible only to code inside the function def and that exists only while the function runs in factbecause all names assigned in any way inside function are classified as local variables by defaultnearly all the names in intersect are local variablesres is obviously assignedso it is local variable arguments are passed by assignmentso seq and seq aretoo the for loop assigns items to variableso the name is also local all these local variables appear when the function is called and disappear when the function exits--the return statement at the end of intersect sends back the result objectbut the name res goes away because of thisa function' variables won' remember values between callsalthough the object returned by function lives onretaining other sorts of state information requires other sorts of techniques to fully explore the notion of locals and statethoughwe need to move on to the scopes coverage of summary this introduced the core ideas behind function definition--the syntax and operation of the def and return statementsthe behavior of function call expressionsand the notion and benefits of polymorphism in python functions as we sawa def statement is executable code that creates function object at runtimewhen the function is later calledobjects are passed into it by assignment (recall that assignment means object reference in pythonwhichas we learned in really means pointer internally)and computed values are sent back by return we also began exploring the concepts of local variables and scopes in this but we'll save all the details on those topics for firstthougha quick quiz test your knowledgequiz what is the point of coding functions at what time does python create function what does function return if it has no return statement in it when does the code nested inside the function definition statement runtest your knowledgequiz