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
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