title: Assign to function return value in while loop condition and catch exceptions along the way
body: <p>I am learning C to assist my understanding of Python.   </p>
  
  <p>It is possible to write code like this in C:</p>
  
  <pre><code>int *ptr;
  while ((c = scanf("%d", ptr)) == 1)
      // do something.
  </code></pre>
  
  <p>In Python, I would write</p>
  
  <pre><code>content = input()
  while True:
      try:
         integer = int(content)
      except:
         print("try again")
         content = input()
      else:
         break
  </code></pre>
  
  <p>The Python code seems clumsy compared with C. Is it possible to write a more succinct version, similar to <code>((c = scanf("%d", ptr)) == 1)</code>?</p>