Code Library
Palindrome :
a palindrome number is a number that remains the same when its digits are reversed1234. for example, 16461, 99, and 1001 are
palindrome numbers12. a palindrome number has reflectional symmetry across a vertical axis1. palindrome numbers can be found in
different number systems, such as decimal, binary, or hexadecimal1. palindrome numbers are different from palindrome words, which
are words that spell the same backwards and forwards
Example,
lol is a palindrome
1223221 is a palindrome
number = int(input("Enter a number: "))
temp = number
reverse = 0
while temp > 0:
digit = temp % 10
reverse = (reverse * 10) + digit
temp = temp // 10
if number == reverse:
print(number, "is a palindrome")
else:
print(number, "is not a palindrome")
Enter a number: 7889887
7889887 is a palindrome