← Back to challenges

Check if a Number is a Palindrome

PythonHardnumbersvalidation

Instructions

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.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: State Names and Abbreviations