Home Project Euler Teaching Projects Gallery

Problem 4: Largest palindrome product

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.


Algorthim:

Again, looking back. This algorthim could have been improved but we essentially start from the first three digit number and multiply with another set of three digit number indicated by the two for loops Simple enough. These problems will get harder..

A little bit about the Palindrome function: I could havee used list() and str() to turn the number into a list of the digits but I found this out later as I learned more about Python. However, this works for now. Notice that the runtime is not that great..

Code:

Result:

Answer: 906609
Runtime: 8.20 seconds