title: What's the difference between findall() and using a for loop with an iterator to find pattern matches
body: <p>I'm using this to calculate the number of sentences in a text:</p>
  
  <pre><code>fileObj = codecs.open( "someText.txt", "r", "utf-8" )
  shortText = fileObj.read()
  
  pat = '[.]'
  
  for match in re.finditer(pat, shortText, re.UNICODE):
      nSentences = nSentences+1
  </code></pre>
  
  <p>Someone told me this is better:</p>
  
  <pre><code>result = re.findall(pat, shortText)
  nSentences = len(result)
  </code></pre>
  
  <p>Is there a difference? Don't they do the same thing?</p>