Python Program to check Given Number is Palindrome or Not

Python Program to check Given Number is Palindrome or Not 

# Palindrome number program

num=int(input("Enter any number:"))

tem=num

reverse_number=0

while tem>0:

    rem=tem%10

    reverse_number=(reverse_number*10)+rem

    tem=tem//10

print(f"The reverse of {num} is:",reverse_number)

if reverse_number==num:

    print(f" The {num} is palindrome")

else:

    print(f"The {num} is not palindrome number")

print("End of Program")


output:

Enter any number:111

The reverse of 111 is: 111

 The 111 is palindrome

End of Program


Another output,

Enter any number:12345

The reverse of 12345 is: 54321

The 12345 is not palindrome number

End of Program

टिप्पणी पोस्ट करा

1 टिप्पण्या

कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏