title: End loop with counter and condition
body: <p>In Python I can implement a loop with step counter and a stop condition as a classical case of <strong>for loop</strong> :</p>
  
  <pre><code>for i in range(50):
      result = fun(i)
      print(i, result)
      if result == 0: 
          break
  </code></pre>
  
  <p>where <code>fun(x)</code> is some arbitrary function from integers to integers. </p>
  
  <p>I always in doubts if that is the best way to code it (<strong>Pythonically</strong>, and in terms of <strong>readability</strong> and <strong>efficiency</strong>) or is it better to run it as a <strong>while loop</strong>:</p>
  
  <pre><code>i = 0
  result = 1
  while result != 0 and i &lt; 50:
      result = fun(i)
      print(i, result)
      i += 1
  </code></pre>
  
  <p>which approach is better? In particular - I'm concerned about the usage of <code>break</code> statement which doesn't feel right.</p>