leetcode 9 -> Palindrome Number

 

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

 

posted @ 2019-03-10 18:07  anobscureretreat  阅读(100)  评论(0编辑  收藏  举报