
x = 5
def f(): 
    x = 7      # create a new name in the local scope 
    print x    # the value for x comes from  the local (function) scope
    
def g():
    f()
    print x    # the value for x comes from the global (module) scope
    
g()