def countSubStringMatchRecursive(target, key):

    def countit(target, key, count):
        index = find(target, key)
if index >= 0:
    target = target[index + len(key):]
count += countit(target, key, count) + 1
return count
return 'No. of instances of', key, 'in', target, 'is', countit(target, key, 0)
How to keep count in a recursive function? [python]