DEV Community

loading...

Discussion on: Project Euler #4 - Largest Palindrome Product

Collapse
handsomespydie profile image
SpyDie • Edited

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.

This is the easiest way and logical too..

list = []

for i in range(901,1000):
    for j in range(901,1000):
        prod = i*j
        if str(prod) == str(prod)[::-1]:
            list.append(prod)

    i += 1
    j += 1

list.sort()

print(list[-1])