A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
Find the largest palindrome made from the product of two 3-digit numbers.
In [15]:
def find_big_pal():
for i in range(999, -1, -1):
pal = i*1000 + int(("%i"%i)[::-1])
for j in range(999, 99, -1):
if pal % j == 0 and len("%i"%(pal/j)) == 3:
return pal,j,pal/j
print find_big_pal()
In [ ]: