9,回文数

class Solution:
    def isPalindrome(self, x: int) -> bool:
        str_x = str(x)
        if str_x[0] == "+":
            str_x = str_x[1:]
        if str_x == str_x[::-1]:
            return True
        else:
            return False

猜你喜欢

转载自blog.csdn.net/weixin_42758299/article/details/88533154
今日推荐