Python Palindrome Number Program | Check Palindrome Example with Code

SOLUTION  :- 

# Program to check whether a number is a palindrome or not # Input from user num = int(input("Enter a number: ")) # Reverse the number rev = 0 temp = num while temp > 0: digit = temp % 10 rev = rev * 10 + digit temp = temp // 10 # Check if original and reversed numbers are same if num == rev: print(f"{num} is a Palindrome number.") else: print(f"{num} is not a Palindrome number.")

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.