title: Find all the occurrences of a character in a string
body: <p>I am trying to find all the occurences of "|" in a string.</p>
  
  <pre><code>def findSectionOffsets(text):
      startingPos = 0
      endPos = len(text)
  
      for position in text.find("|",startingPos, endPos):
          print position
          endPos = position
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>    for position in text.find("|",startingPos, endPos):
  TypeError: 'int' object is not iterable
  </code></pre>