programming-examples/python/Math/Find the next smallest palindrome of a specified number.py
2019-11-15 12:59:38 +01:00

9 lines
265 B
Python

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));