Created
November 22, 2011 03:37
-
-
Save ehayon/1384823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max_n1, max_n2, max_prod = 0, 0, 0 | |
for n1 in range(100, 1000): | |
for n2 in range(100, 1000): | |
product = str(n2 * n1) | |
if product == product[::-1]: | |
if max_prod < int(product): | |
max_prod = int(product) | |
max_n1 = n1 | |
max_n2 = n2 | |
print str(max_n1) + " x " + str(max_n2) + " = " + str(max_prod) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment