while True:
    pos = haystack.find(char, pos + 1)
if pos == -1:
    return result
if len(needle) == 1:
    result += 1
else:
    result += count(haystack[pos + 1:], needle[1:])
Find all occurrences of a divided substring in a string