Skip to content

Commit 07bfabe

Browse files
authored
Merge pull request DeepNinja07x#72 from rohansharma4050/master
palindrome number code in python
2 parents ecb2cfb + 4716f65 commit 07bfabe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

palindrome.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
num=int(input("Enter a number:"))
2+
temp=num
3+
rev=0
4+
while(num>0):
5+
dig=num%10
6+
rev=rev*10+dig
7+
num=num//10
8+
if(temp==rev):
9+
print("The number is palindrome!")
10+
else:
11+
print("Not a palindrome!")

0 commit comments

Comments
 (0)