title: Python: Is it possible to know how many iterations are in an iterator object beforehand?
body: <p>So far if I wanted to know how many iterations there are in an iterator (in my case that's how many protein sequences in a file) I did:</p>
  
  <pre><code>count = 0
  for stuff in iterator:
      count += 1
  print count
  </code></pre>
  
  <p>However, I want to seperate the iterator into half so I need to know the total amount of iterations. Is there a way to know the amount of iterations there will be without looping through the iterator?</p>