In [17]:
def toChars(s):
    import string
    s = s.lower()
    ans = ''
    for c in s:
        if c in string.ascii_lowercase:
            ans = ans + c
    return ans

In [6]:
def isPalindrome(s):
    if len(s) <= 1:
        return True
    else:
        return (s[0] == s[-1]) and isPalindrome(s[1:-1])

In [18]:
s = input().strip()
print(isPalindrome(toChars(s)))


Gattag
True

In [ ]: