题目链接:https://leetcode-cn.com/problems/palindrome-number/description/
class Solution: def reverse(self, x): if (x < 0): return False temp = str(x)[::-1] temp = int(temp) if (temp == x): return True else: return False if __name__ == '__main__': s1 = Solution() result = s1.reverse(1221) print (result)