UnboundLocalError: local variable 'a' referenced before assignment
<p>if execute the following code will show error message:</p>

<p><strong>UnboundLocalError: local variable 'a' referenced before assignment</strong></p>

<pre><code>a = 220.0
b = 4300.0
c = 230.0/4300.0

def fun():
    while (c &gt; a/b):
        a = a + 1
        print a/b

if __name__ == '__main__':
    fun()
</code></pre>

<p>but modify to :</p>

<pre><code>a = 220.0
b = 4300.0
c = 230.0/4300.0

def fun():
    aa = a
    bb = b
    while (c &gt; aa/bb):
        aa = aa + 1
        print aa/bb

if __name__ == '__main__':
    fun()
</code></pre>

<p>it will fine.
Any advice or pointers would be awesome. Thanks a lot!</p>
