Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (12 sloc) 361 Bytes
"""
Problem 4. Largest palindrome product.
http://static.projecteuler.net/problem=4
"""
def main():
rng = range(100, 1000)
products_set = {i*j for i in rng for j in rng}
is_palindrome = lambda num: str(num) == str(num)[::-1]
palindromes = filter(is_palindrome, products_set)
print(max(palindromes))
if __name__ == '__main__':
main()