title: Python: While Loop Check Throughout Loop if True
body: <p>I have a very simple problem: I have made a while loop, and in the middle of it, set the initial condition to false. This, however, does not stop the loop and runs entirely through, (somewhat obviously,) until it attempts to unsuccessfully go through again. Here is a simplified construction of what I have.</p>
  
  <pre><code>while(a):
      print("hi")
      a = False
      print("bye")
  </code></pre>
  
  <p>This returns:</p>
  
  <pre><code>hi
  bye
  </code></pre>
  
  <p>Again I would like to only return <code>hi</code>; I want the loop to continually check if its satisfied. </p>
  
  <p>Any help greatly appreciated.</p>