Skip to content

Commit

Permalink
Merge pull request sourabhjagtap95#33 from sourabhjagtap95/hack-2020-1
Browse files Browse the repository at this point in the history
Create Next_smallest_Palindrome.py
  • Loading branch information
sourabhjagtap95 authored Oct 15, 2020
2 parents 1a7a78a + d1ffa3f commit 077373b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Next_smallest_Palindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sys
def Next_smallest_Palindrome(num):
numstr = str(num)
for i in range(num+1,sys.maxsize):
if str(i) == str(i)[::-1]:
return i

print(Next_smallest_Palindrome(99));
print(Next_smallest_Palindrome(1221));

0 comments on commit 077373b

Please # to comment.