functionsscopingand abstraction because functions are objectsand can be returned just like any other kind of object soz can be bound to the value returned by fand the function call (can be used to invoke the function that was bound to the name within --even though the name is not known outside the context of sowhat does the code in figure printit prints abc abc the order in which references to name occur is not germane if an object is bound to name anywhere in the function body (even if it occurs in an expression before it appears as the left-hand-side of an assignment)it is treated as local to that function considerfor examplethe code def ()print def ()print ( (it prints when is invokedbut an error message is printed when it encounters the print statement in because the assignment statement following the print statement causes to be local to and because is local to git has no value when the print statement is executed confused yetit takes most people bit of time to get their head around scope rules don' let this bother you for nowcharge ahead and start using functions most of the time you will find that you only want to use variables that are local to functionand the subtleties of scoping will be irrelevant the wisdom of this language design decision is debatable