62. Python Program to find the given number is Palindrome or Not.
How does this program work?
- In this program you are going to learn about to check if a number is Palindrome number or not using Python.
- A palindrome number is a number which means if it remains same even after reversing the digits.
- A number said to be a palindrome if original number is equal to the reverse number other wise it is not a palindrome.
Here is the code
n = int(input("Enter number: "))
temp = n
a = 0
while temp > 0:
b = temp % 10
a = a*10+b
temp//= 10 #(temp = int ( temp/10 ))
if(n == a):
print(n," is a palindrome")
else:
print(n," isn't a palindrome")