<jupyter_start><jupyter_text><jupyter_code># Math
# str(x): convert int to string
# [::-1]: reverse string
# if x=-121, str(x)[::-1] = '121-', '-121' is not palindrome
class Solution:
    def isPalindrome(self, x):
        """
        type x: int
        rtype: bool
        """
        if  x<0:
          return False
        return str(x) == str(x)[::-1]

        

        

x=-121
isPalindrome(x)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16511627906976745, 'fraction_numerical': 0.037209302325581395, 'mean_word_length': 2.1925925925925926, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '569087', 'license': 'MIT', 'n_tokens_mistral': 173, 'n_tokens_neox': 161, 'n_words': 37, 'path': '9. Palindrome Number.ipynb', 'repo_name': 'Freya-LR/Leetcode', 'size': '430'}