functions reduce the need for duplicate code this makes programs shortereasier to readand easier to update the code in function executes when the function is callednot when the function is defined the def statement defines (that iscreatesa function function consists of the def statement and the code in its def clause function call is what moves the program execution into the functionand the function call evaluates to the function' return value there is one global scopeand local scope is created whenever function is called when function returnsthe local scope is destroyedand all the variables in it are forgotten return value is the value that function call evaluates to like any valuea return value can be used as part of an expression if there is no return statement for functionits return value is none global statement will force variable in function to refer to the global variable the data type of none is nonetype that import statement imports module named areallyourpetsnamederic (this isn' real python moduleby the way this function could be called with spam bacon( place the line of code that might cause an error in try clause the code that could potentially cause an error goes in the try clause the code that executes if an error happens goes in the except clause appendix the empty list valuewhich is list value that contains no items this is similar to how 'is the empty string value spam[ 'hello(notice that the third value in list is at index because the first index is ' (note that ' is the string ' 'which is passed to int(before being divided by this eventually evaluates to expressions can be used wherever values are used ' (negative indexes count from the end [' '' ' [ 'cat' 'cat'true [ 'cat'true