Here is my take if you want to avoid slicing the string at each level.
def palindrome(s, i=0, j=None): if j == None: j = len(s) - 1 if i > j: return True return s[i] == s[j] and palindrome(s, i + 1, j - 1)