Palindrome Number
答案:
class Solution:
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
orig = x
rev = 0
if x >= 0:
while x > 0:
dig = x % 10
rev = rev * 10 + dig
x = x // 10
if rev == orig:
return True
else:
return False
else:
return False