Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Integer Palindrome by mortonfox
def int_palindrome(number: int, B: int) -> bool:
num = []
while number:
number, rem = divmod(number, B)
num.insert(0, rem)
return num == num[::-1]
print("Example:")
print(int_palindrome(455, 2))
assert int_palindrome(6, 2) == False
assert int_palindrome(34, 2) == False
assert int_palindrome(455, 2) == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
Sept. 9, 2022
Comments: