euler/004.py
Correl Roush 9d96efdaf3 Problem 004
git-svn-id: file:///srv/svn/euler@22 e5f4c3ec-3c0c-11df-b522-21efaa4426b5
2010-04-12 15:53:02 +00:00

11 lines
378 B
Python

def palindrome():
palindromes = {}
for i in range(999, 99, -1):
for ii in range(999,99, -1):
result = str(i * ii)
if result == result[::-1]:
palindromes[i * ii] = [i, ii]
p = sorted(palindromes.keys(), reverse=True)[0]
print 'Palindrome: {0}x{1}: {2}'.format(palindromes[p][0], palindromes[p][1], p)
palindrome()