title: Global variable not saving updated value
body: <p>I have a global variable <code>foo</code>. I am using a function to add a number (which is sent as parameter to the function) to <code>foo</code>. The first time I call this function, it runs fine, but the second time I run this, it only gives me the sum of initial value of <code>foo</code> and the number passed as parameter. I am new to python and following is my code.</p>
  
  <pre><code>foo = 5
  def add_number_to_foo(num):
      global foo
      return foo + num
  
  add_number_to_foo(5)  # returns 10 which is fine
  
  add_number_to_foo(6)  # returns 11, I should have got 16
  </code></pre>
  
  <p>I am a newbie in python, please excuse me if the question is ignorant. Thanks.</p>