Skip to content

Commit 5e81d01

Browse files
Update pal.py
done without strings...please now merge it for hacktoberfest
1 parent 78d875d commit 5e81d01

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pal.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
s=int(input())
2-
r=str(s)
3-
rev=r[::-1]
4-
if rev==r:
1+
n=int(input())
2+
r=0
3+
while n>0:
4+
d=n%10
5+
r=r*10+d
6+
n=n/10
7+
if n==r:
58
print (True)
69
else:
7-
print (False)
10+
print (False)

0 commit comments

Comments
 (0)