Найти все вхождения символа в строке

Я пытаюсь найти все случаи "|" в строке.

def findSectionOffsets(text):
    startingPos = 0
    endPos = len(text)

    for position in text.find("|",startingPos, endPos):
        print position
        endPos = position

Но я получаю ошибку:

    for position in text.find("|",startingPos, endPos):
TypeError: 'int' object is not iterable

Ответы на вопрос(7)

Ваш ответ на вопрос