Created
July 8, 2010 23:09
-
-
Save jl2/468787 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
#!/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