Project Euler: Problem 4

https://projecteuler.net/problem=4

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 [21]:
# YOUR CODE HERE

pal = 0
for x in range(1,1000):
    for a in range(1,1000):
        if str(x*a) == (str(x*a)[::-1]) and (x*a) > pal:
            pal = (x*a)

print(pal)


906609

In [ ]:
# This cell will be used for grading, leave it at the end of the notebook.