Python program to check whether a number is palindrome.

In this python if else program, we will check whether any given number is palindrome number or not. 

A palindrome number is a number that remains the same when digits are reversed. For example, the number 121 is a palindrome number, but 253 is not a palindrome number.

Hint:
Use string.
Use indexing.

Steps to solve the program
  1. Take a number as input.
  2. Reverse the given number and store it in another variable.
  3. Check whether both the numbers are equal or not using an if-else statement.
  4. Print the respective output.
				
					num1 = 121
num2 = str(num1)

if num1 == int(num2[::-1]):
    print("It is a palindrome number")
else:
    print("It is not a palindrome number")
				
			

Output :

				
					It is a palindrome number
				
			

Related Articles

check any person eligible to vote or not

check if any given string is palindrome or not

Leave a Comment