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 [22]:
n = 0 #variable, value holder
def euler_pal(x):
    return str(x) == str(x) [::-1] # making sure that the string of characters is equal in both directions
for x in range(100, 999):

    for y in range(x+1, 10000):
        z = x * y
        if euler_pal(z):
            n = z

print(n)


8743478

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

In [ ]:


In [ ]:


In [ ]: