From 4716f659d4b158caaf7214de64d6aa435d67c7f0 Mon Sep 17 00:00:00 2001 From: Rohan Sharma <69635604+rohansharma4050@users.noreply.github.com> Date: Fri, 1 Oct 2021 01:51:14 +0530 Subject: [PATCH] palindrome number code in python --- palindrome.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 palindrome.py diff --git a/palindrome.py b/palindrome.py new file mode 100644 index 0000000..7967002 --- /dev/null +++ b/palindrome.py @@ -0,0 +1,11 @@ +num=int(input("Enter a number:")) +temp=num +rev=0 +while(num>0): + dig=num%10 + rev=rev*10+dig + num=num//10 +if(temp==rev): + print("The number is palindrome!") +else: + print("Not a palindrome!") \ No newline at end of file