title: Function not changing global variable
body: <p>my code is as follow:</p>
  
  <pre><code>done = False
  
  def function():
      for loop:
          code
          if not comply:
              done = True  #let's say that the code enters this if-statement
  
  while done == False:
      function()
  </code></pre>
  
  <p>For some reason when my code enters the if statement, it doesn't exit the while loop after it's done with function().</p>
  
  <p>BUT, if I code it like this:</p>
  
  <pre><code>done = False
  
  while done == False:
      for loop:
      code
      if not comply:
          done = True  #let's say that the code enters this if-statement
  </code></pre>
  
  <p>...it exits the while loop. What's going on here?</p>
  
  <p>I made sure that my code enters the if-statement. I haven't run the debugger yet because my code has a lot of loops (pretty big 2D array) and I gave up on debugging due to it being so tedious. How come "done" isn't being changed when it's in a function?</p>