Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Strip and join solution in Clear category for Integer Palindrome by amandel
def int_palindrome(number: int) -> bool:
a = 0
while number > a:
a = 10*a+number%10
number//=10
return number == a or number == a//10
print("Example:")
print(int_palindrome(151))
assert int_palindrome(151) == True
assert int_palindrome(212) == True
assert int_palindrome(321) == False
print("The mission is done! Click 'Check Solution' to earn rewards!")
Aug. 24, 2022
Comments: