Advertisement
Guest User

is_pali

a guest
Jul 4th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def is_pali(x):
  2.     y = str(x)
  3.     if y == y[::-1]:
  4.         return True
  5.     return False
  6.  
  7. a = int(raw_input())
  8. for i in xrange(a):
  9.     b = int(raw_input()) +1
  10.     while 1:
  11.         if is_pali(b):
  12.             print b
  13.             break
  14.         b+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement