mirror of
https://github.com/correl/euler.git
synced 2024-11-27 11:09:54 +00:00
Correl Roush
715e24dcf3
excecutable code if they are called directly. git-svn-id: file:///srv/svn/euler@29 e5f4c3ec-3c0c-11df-b522-21efaa4426b5
11 lines
408 B
Python
11 lines
408 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)
|
|
if __name__ == '__main__':
|
|
palindrome()
|