判断回文数

class Solution:
    def isPalindrome(self, x):

        if str(x).startswith('-'):
            return False
        else:
            a = str(x)
            b = a[::-1]
            if a == b:
                return True
            else:
                return False

posted on 2020-06-09 13:01  阿虾  阅读(120)  评论(0编辑  收藏  举报

导航