Skip to content

Instantly share code, notes, and snippets.

@jl2
Created July 8, 2010 23:09
Show Gist options
  • Save jl2/468787 to your computer and use it in GitHub Desktop.
Save jl2/468787 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
def is_palindrome(number):
return str(number) == str(number)[::-1]
if __name__ == "__main__":
# Assumes that the largest palindrome will be created by two numbers in the range 900-1000
print('{}*{} = {}'.format(*max((i,j,i*j)
for i in range(1000, 900, -1)
for j in range(1000, 900, -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment