Skip to content

Instantly share code, notes, and snippets.

@jamespenguin
Created January 8, 2015 06:03
Show Gist options
  • Save jamespenguin/ce159c6f0946a2ae34c9 to your computer and use it in GitHub Desktop.
Save jamespenguin/ce159c6f0946a2ae34c9 to your computer and use it in GitHub Desktop.
def is_palindrome(number):
s = str(number)
r = list(s)
r.reverse()
return "".join(r) == s
results = []
for num_1 in range(999, 99, -1):
for num_2 in range(999, 99, -1):
if is_palindrome(num_1 * num_2):
results.append(num_1 * num_2)
results.sort()
print results[-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment