方法一:转化为字符串,然后反转
class Solution:
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
if x<0:
return False
else:
x=str(x)
y=x[::-1]
if x==y:
return True
else:
return False