functions are the primary way to compartmentalize your code into logical groups since the variables in functions exist in their own local scopesthe code in one function cannot directly affect the values of variables in other functions this limits what code could be changing the values of your variableswhich can be helpful when it comes to debugging your code functions are great tool to help you organize your code you can think of them as black boxesthey have inputs in the form of parameters and outputs in the form of return valuesand the code in them doesn' affect variables in other functions in previous single error could cause your programs to crash in this you learned about try and except statementswhich can run code when an error has been detected this can make your programs more resilient to common error cases practice questions why are functions advantageous to have in your programswhen does the code in function executewhen the function is defined or when the function is called what statement creates function what is the difference between function and function call how many global scopes are there in python programhow many local scopes what happens to variables in local scope when the function call returns what is return valuecan return value be part of an expression if function does not have return statementwhat is the return value of call to that function how can you force variable in function to refer to the global variable what is the data type of none what does the import areallyourpetsnamederic statement do if you had function named bacon(in module named spamhow would you call it after importing spam how can you prevent program from crashing when it gets an error what goes in the try clausewhat goes in the except clausefunctions