Variables created in functions are scoped in that function
global variable
Variables not declared in a function
accessible from any function within the same module or script
"""Won't work!"""total = 0def increment(): total == 1 return totalincrement() #ERRORRRRR"""Works using global keyword"""def increment(): global total total += 1 return total
nonlocal variable
used in nested functions to indicate that a variable refers to a variable in the nearest enclosing scope that is not global