写的不是很优雅,但是可以跑
class Solution:
def isPalindrome(self, x: int) -> bool:
if x <0:
return False
list = []
while x!= 0:
list.append(x%10)
x=x//10
length = len(list)
for i in range(length//2):
if list[i] != list[length-i-1]:
return False
return True