print( now from instancenotice here how manynames (prints the in manynamesnot the assigned in this file --scopes are always determined by the position of assignments in your source code ( lexicallyand are never influenced by what imports what or who imports whom alsonotice that the instance' own is not created until we call ()--attributeslike all variablesspring into existence when assignedand not before normally we create instance attributes by assigning them in class __init__ constructor methodsbut this isn' the only option finallyas we learned in it' also possible for function to change names outside itselfwith global and (in python xnonlocal statements--these statements provide write accessbut also modify assignment' namespace binding rulesx global in module def ()print(xreference global in module ( def ()global change global in module def () def nested()print(xdef () def nested()nonlocal local in function reference local in enclosing scope ( local in function python statement change local in enclosing scope of courseyou generally shouldn' use the same name for every variable in your script --but as this example demonstrateseven if you dopython' namespaces will work to keep names used in one context from accidentally clashing with those used in another nested classesthe legb scopes rule revisited the preceding example summarized the effect of nested functions on scopeswhich we studied in it turns out that classes can be nested too-- useful coding pattern in some types of programswith scope implications that follow naturally from what you already knowbut that may not be obvious on first encounter this section illustrates the concept by example though they are normally coded at the top level of moduleclasses also sometimes appear nested in functions that generate them-- variation on the "factory function( closuretheme in with similar state retention roles there we noted namespacesthe conclusion