Question about recursive approach


#1

Could anybody help me to understand why this code fails with
“maximum recursion depth exceeded in comparison”
?

def solve(self, st):
        def palindromPossible(st, left, right, tries):
            if left >= right:
                return 1
            if st[left] != st[right]:
                if tries:
                    if palindromPossible(st, left+1, right, 0):
                        return 1
                    if palindromPossible(st, left, right-1, 0):
                        return 1
                    return 0
                else:
                    return 0
            else:
                return palindromPossible(st, left+1, right-1, tries)
            
        return palindromPossible(st, 0, len(st)-1, 1)