水水过,采用最简单的写法, string[::-1]来翻转一个字符串
class Solution:
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
strx = str(x)
if strx == strx[::-1]:
return True
else:
return False