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 [1]:
# function to test palindrome
def is_palendrome(num):
    return str(num) == str(num)[::-1]

palindromes = []
for i in range(100,1000):
    for j in range(i, 1000):
        prod = i * j
        if is_palendrome(prod):
            palindromes.append(prod)
            
print(max(palindromes))


906609

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