
class Solution(object):
? ? def isPalindrome(self, x):
? ? ? ? """
? ? ? ? :type x: int
? ? ? ? :rtype: bool
? ? ? ? """
? ? ? ? #倒著切片,如果是復數一定不是
? ? ? ? if(x>=0):
? ? ? ? ? ? y=int(str(x)[::-1])
? ? ? ? ? ? if y==x:
? ? ? ? ? ? ? ? return True
? ? ? ? ? ? else:
? ? ? ? ? ? ? ? return False
? ? ? ? return False