title: While loop not updating
body: <p>Versions of this have been asked before but I don't get it, so I need to ask again with a simple test case. Having several functions is relevant to the actual program I'm writing, but I'm trying to understand the fault on a simple case.</p>
  <pre><code>a = 0
  
  def test(c):
      c = c + 2
      return c
      
  def test2():
      ct = 0
      while True:
          print(test(a))
          ct += 1
          if ct &gt; 4:
              break
      
  test2()
  </code></pre>
  <p>Running this prints '2' five times. Why wouldn't it update each time? How would I get it to update?</p>
  <p>The same thing happens if I do something like this:</p>
  <pre><code>a = 0
  
  def test(c):
      c = c + 2
      return c
      
  def test2():
      d = a
      ct = 0
      while True:
          print(test(d))
          ct += 1
          if ct &gt; 4:
              break
      
  test2()
  </code></pre>
  <p>test() returns a value for d which is within the loop. So, I can't see where it would get reset back to 0.</p>