Why can you read, but not modify, global values?
<pre><code>&gt;&gt;&gt; import sys
&gt;&gt;&gt; print(sys.version)
2.4.4
&gt;&gt;&gt; b = 11
&gt;&gt;&gt; def foo2():
...    a = b
...    print a, b
...
&gt;&gt;&gt; foo2()
11 11
&gt;&gt;&gt; def foo3():
...    a = b 
...    b = 12
...    print a, b
...
&gt;&gt;&gt; foo3()
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "&lt;stdin&gt;", line 2, in foo3
UnboundLocalError: local variable 'b' referenced before assignment
&gt;&gt;&gt; def foo4():
...    global b
...    a = b
...    b = 12
...    print a, b
...
&gt;&gt;&gt; foo4()
11 12
</code></pre>

<p><strong>Question</strong>> In <code>foo3</code>, why you can access global variable without declaring it but you still cannot modify it.</p>
