Hi I tried the following example (i don't have im in the global) and found that the program actually runs and outputs 10.
Is Python dynamic scoped?
def useGlobal():
def inSide():
print 'inside',
print b
b = 5
print im
inSide()
if __name__ == '__main__':
im = 10
useGlobal()
__name__,im, anduseGlobal.