# Python Program to check if the given number is a palindrome number

Here’s an example Python code to check if a given number is a palindrome:

# Define a function to check if a number is a palindrome
def is_palindrome(num):
# Convert the number to a string and reverse it
reversed_num_str = str(num)[::-1]
# Compare the original and reversed strings
return str(num) == reversed_num_str

# Test the function with some sample numbers
num1 = 12321
num2 = 12345
if is_palindrome(num1):
print(num1, "is a palindrome.")
else:
print(num1, "is not a palindrome.")
if is_palindrome(num2):
print(num2, "is a palindrome.")
else:
print(num2, "is not a palindrome.")

In this code, we define a function is_palindrome() that takes one argument num and returns True if the number is a palindrome, and False otherwise. To check if the number is a palindrome, we first convert it to a string using the str() function. We then use slicing with a step value of -1 to reverse the string. Finally, we compare the original string and the reversed string to check if they are equal.

In the main program, we test the is_palindrome() function with some sample numbers num1 and num2. We use an if statement to check if each number is a palindrome, and use the print() function to output the result.

When you run this code, it should output:

12321 is a palindrome.
12345 is not a palindrome.

Note that you can replace the sample numbers with any other numbers you want to test the function with.

## Related Examples

### 15. Print the sum of the current number and the previous number in Python

Wordpress Social Share Plugin powered by Ultimatelysocial
Wordpress Social Share Plugin powered by Ultimatelysocial
hacklink al dizi film izle film izle yabancı dizi izle fethiye escort bayan escort - vip elit escort erotik film izle hack forum türk ifşa the prepared organik hit hiltonbetbetebetmarsbahishasbetSüpertotobetjojobetcasinolevantjojobetjojobet girişJojobetbetebetmarsbahiscasibom adresjojobetjojobetjojobet girişcratosroyalbetcratosroyalbetcasibom girişcasibom girişbetciocasibombetriyalbaywin girişgrandpashbetCasinoplus girişultrabetJojobetjojobetjojobettümbet girişJojobetjojobet girişjojobetcasibomjojobet girişJojobettümbet giriştümbet twitterultrabet girişlunabet girişasyabahiscasibomlunabetvaycasinomegabahismatadorbetbaywinbaywin girişpadişahbetbetorspinpornpoocoinbettilt girişbettilt twittermarsbahisbettilt twitterbettilt girişvaycasinobelle delphine leakartemisbetsonbahis sonbahis güncelBetwoonMeritkingBetwoonBetwoon Twitter