Skip to content
Home » Python Programs » Python Program to Check Palindrome Number Using Functions

Python Program to Check Palindrome Number Using Functions

Simple python program to check palindrome number using functions. In this program we can execute the palindrome number using functions for beginners.

Palindrome Number Definition

A palindrome, such as madam or racecar, is a word, number, phrase, or other sequence of characters that reads the same backward as forward. Date/time stamps with short digits 11/11/11 11:11 and long digits 02/02/2020 are examples of numeric palindromes. 

Function Definition in Python

A function is a named section of code in computer programming that performs a specific task. This usually entails taking some data, manipulating it, and then returning a result. Using this functions here we have executed the python program to check palindrome number using functions.

Python Program to Check Palindrome Number Using Functions

def isPalindrome(n):  
    reverse = 0
    reminder = 0
    while(n != 0):
        remainder = n % 10
        reverse = reverse * 10 + remainder
        n = int(n / 10)
    return reverse
num = int(input('Enter The Number'))
reverse = isPalindrome(num)
if(num == reverse):
  print(num,'is a Palindrome')
else:
  print(num,'is not a Palindrome')

Output:
Enter The Number456
456 is not a Palindrome