title: Incrementing integer variable of global scope in Python
body: <p>I am trying to change global value <code>x</code> from within another functions scope as the following code shows,</p>
  
  <pre><code>x = 1
  def add_one(x):
      x += 1
  </code></pre>
  
  <p>then I execute the sequence of statements on Python's interactive terminal as follows.</p>
  
  <pre><code>&gt;&gt;&gt; x
  1
  &gt;&gt;&gt; x += 1
  &gt;&gt;&gt; x
  2
  &gt;&gt;&gt; add_one(x)
  &gt;&gt;&gt; x
  2
  </code></pre>
  
  <p>Why is <code>x</code> still 2 and not 3?</p>