Accept a number and check whether it is palindrome or not
n=int(input("Enter number:"))
temp=n
rev=0
while(n>0):
dig=n%10
rev=rev*10+dig
n=n//10
if(temp==rev):
print("The number is a palindrome!")
else:
print("The number isn't a palindrome!")
Study more about Python at Python Class 10
1.5k questions
1.4k answers
4 comments
12.3k users