Write a program to check and print whether a number is palindrome or not


Topic: Write a program to check and print whether a number is palindrome or not

Solution

num = 12321
temp = num
rev = 0
while num > 0:
    dig = num % 10
    rev = rev*10 + dig
    num//=10
if temp==rev :
    print("The number is a palindrome!")
else:
    print("The number isn't a palindrome!")



List all Python Programs