From 7451b4abdb37858d5def2dac259266fbcac9f1a5 Mon Sep 17 00:00:00 2001 From: VASUNTHARA22 Date: Tue, 6 May 2025 21:06:27 +0530 Subject: [PATCH] Update Loops-Palindrome Number check.md --- Loops-Palindrome Number check.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Loops-Palindrome Number check.md b/Loops-Palindrome Number check.md index 15dd6d692..c440e982f 100644 --- a/Loops-Palindrome Number check.md +++ b/Loops-Palindrome Number check.md @@ -16,7 +16,21 @@ To write a Python program that checks whether a given number is a **palindrome** - Else, print that it is not a palindrome. ## 🧾 Program -Add code Here +```rev=0 +temp=num +while temp>0: +rev=(10*rev)+temp%10 +temp//=10 +if rev==num: +print("The given number {} is a Palindrome".format(num)) +else: +print("The given number {} is not a palindrome".format(num)) +``` ## Output +![438595943-241d2369-4bf9-486d-8ef7-858b4f6a851b](https://github.com/user-attachments/assets/5669a639-d89f-4f88-8b74-7828ae0ecf40) + + ## Result +Thus, the program has been successfully executed +