leetcode Palindrome Number python

class Solution(object):
    def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
        if x < 0:
            return False
        x=str(x)
        i=0
        j=len(x)-1
        while i < j:
            if x[i] != x[j]:
                return False
            i+=1
            j-=1
        return True
原文地址:https://www.cnblogs.com/allenhaozi/p/4957180.html