title: Python Assign value to variable during condition in while Loop
body: <p>A simple question about Python syntax. I want to assign a value from a function to a variable during the condition for a while loop. When the value returned from the function is false, the loop should break. I know how to do it in PHP.</p>
  
  <pre><code>while (($data = fgetcsv($fh, 1000, ",")) !== FALSE) 
  </code></pre>
  
  <p>However when I try a similar syntax in Python I get a syntax error.  </p>