Skip to content

Instantly share code, notes, and snippets.

@ehayon
Created November 22, 2011 03:37
Show Gist options
  • Save ehayon/1384823 to your computer and use it in GitHub Desktop.
Save ehayon/1384823 to your computer and use it in GitHub Desktop.
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