Problem 4 from the Project Euler website.

## The Problem

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is

9009 = 91 x 99

Find the largest palindrome made from the product of two 3-digit numbers.

## My Solution

First I did 999 x 999 to figure out the maximum number of digits the palindrome could have (6 digits).

Then I worked with a small range from 900 to 999 and multiplied them, printing only palindromes….

for x in range(900,999): for y in range(900,999): # Multuply all the things z=x*y # change it to string so we can pick up all the different digits zStr=str(z) # reverse the order of the last 3 digits zDigs=zStr[-1]+zStr[-2]+zStr[-3] # conditionals if len(zStr)==6 and zStr[:3]==zDigs: print x,"x",y,"=",x*y

which returns something like

... 902 x 909 = 819918 902 x 914 = 824428 909 x 902 = 819918 ...

Easy stuff.