Skip to content

Instantly share code, notes, and snippets.

@mtayseer
Last active August 29, 2015 13:56
Show Gist options
  • Save mtayseer/9009867 to your computer and use it in GitHub Desktop.
Save mtayseer/9009867 to your computer and use it in GitHub Desktop.
def is_palindrome(x):
x = str(x)
return x == x[::-1]
def find_palindromes(m, n):
for i in xrange(m, n):
for j in xrange(i, n):
x = i * j
if is_palindrome(x):
yield x
print max(find_palindromes(100, 1000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment