title: How to do variable assignment inside a while(expression) loop in Python?
body: <p>I have the variable assignment in order to return the assigned value and compare that to an empty string, directly in the while loop.</p>
  
  <p>Here is how I'm doing it in PHP:</p>
  
  <pre><code>while((name = raw_input("Name: ")) != ''):
      names.append(name)
  </code></pre>
  
  <p>What I'm trying to do is identical to this in functionality:   </p>
  
  <pre><code>names = []
  while(True):
      name = raw_input("Name: ")
      if (name == ''):
          break
      names.append(name)
  </code></pre>
  
  <p>Is there any way to do this in Python?</p>