回文数(python)

class Solution(object):
def isPalindrome(self, x):
pop = 0
y = x
if x < 0:
print("false")
elif x >= 0 :
while x != 0 :
i = x % 10
x = x // 10
pop = pop*10 + i
if y == pop :
return "true"
else:
print("false")
#真想吐槽这测评平台。。。
posted @ 2019-08-23 19:18  黎黎黎黎  阅读(680)  评论(0编辑  收藏  举报