n=999*999
pal=0
def is_pal(n):
nlist = list(str(n))
front = nlist[:int(len(nlist)/2)]
nlist.reverse()
back = nlist[:int(len(nlist)/2)]
if front == back:
print str(n) + " is a palindrome."
return 1
else:
return 0
while pal == 0:
if n%11 == 0 and is_pal(n):
pal = n
n -= 1