title: What is the most pythonic way to iterate over a list until a condition is met?
body: <p>I have a list of real values:</p>
  
  <pre><code>values = [0.1, 2.9, 1.4, 5.7, 9.2, 3.8]
  </code></pre>
  
  <p>I want to have the number of items iterated over, until some condition was met. For example, if the condition was <code>item &gt; 5</code>, the result would be 3.</p>
  
  <p>The easiest way, and perhaps most straight-forward way to do this would be:</p>
  
  <pre><code>for index, item in enumerate(values):
      if (item &gt; 5):
          print(index)
          break
  </code></pre>
  
  <p>Is there any other way <strong>more pythonic, preferably one-liner</strong>, which does this?</p>