def count(char, text):

    def count_helper(index):
        return 0 if index < 0 else (text[index] == char) + count_helper(
            index - 1)
return count_helper(len(text) - 1)
Converting a iteration into recursion