class Solution:
def isPalindrome(self, x: int) -> bool:
a = x
if a<0:
return False
else:
num = 0
while(a!=0):
temp = a%10
a = a//10
num = num*10+temp
if num==x:
return True
else:
return False
2024-04-10 19:18:18
class Solution:
def isPalindrome(self, x: int) -> bool:
a = x
if a<0:
return False
else:
num = 0
while(a!=0):
temp = a%10
a = a//10
num = num*10+temp
if num==x:
return True
else:
return False