LeetCode(9)Palindrome Number

题目如下:

Python代码:

    def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
        if(x>=0):
            s = int(str(x)[::-1])
            if(x==s):
                return True
            else:
                return False
        else:
            return False

 

posted @ 2017-07-02 17:08  Single、Dog  阅读(89)  评论(0编辑  收藏  举报