Global variables in Python
<p>Hi I tried the following example (i <strong>don't</strong> have <code>im</code> in the global) and found that the program actually runs and outputs 10. </p>

<p>Is Python dynamic scoped? </p>

<pre><code>def useGlobal():
    def inSide():
        print 'inside',
        print b
    b = 5
    print im
    inSide()

if __name__ == '__main__':

    im = 10
    useGlobal()
</code></pre>
