Here you will get python program to check palindrome number.
A number is said to be palindrome if it is equal to its reverse. For example 121, 555, etc are palindrome while 124, 367, etc are not.
Python Program to Check Palindrome Number
num = int(input("enter a number: ")) temp = num rev = 0 while temp != 0: rev = (rev * 10) + (temp % 10) temp = temp // 10 if num == rev: print("number is palindrome") else: print("number is not palindrome")
Output
enter a number: 12321
number is palindrome
Video Tutorial
Comment below if you have any queries regarding python palindrome number program.
Please can you explain the while loop statement
Thanks for helping me out.
Thanks!
Program was goooooooood and thanks for helps
Thankyou so much Neeraj ! it was fun learning from you!!!
-Andrea Evangelin
124 -sample input
545 is palindrom sample output
how to prove it is palidrom
we know that pallindrme no are those no which have same digit on reversing
a=’12321′
if a==a[::-1]:
print(“Palindrome number”)
else:
print(“Not a palindrome number”)