def isPalindrome(x):
    if x < 0:
        return False
    copy, reverse = x, 0
    while copy:
        reverse *= 10
        reverse += int(copy % 10 )
        copy = int(copy/10)
    return x == reverse

if __name__ == '__main__':
    x = 12321
    print(isPalindrome(x))
