Check if a Number is a Palindrome

Published by Helen Yu in

Write a function that returns True if a number is a palindrome.

Examples

is_palindrome(838) ➞ True

is_palindrome(4433) ➞ False

is_palindrome(443344) ➞ True

Notes

  • A palindrome is a number that remains the same when reversed.
  • Bonus: Try solving this without turning the number into a string.
Watch a quick demo on how Edabit works.