Daniele Fucini 4e6b5c774f
Add function to projecteuler library
Added the function is_palindrome to the projecteuler library
2019-09-21 15:44:42 +02:00

26 lines
526 B
Python

#!/usr/bin/python3
from timeit import default_timer
from projecteuler import is_palindrome
def main():
start = default_timer()
max_ = 0
for i in range(999, 99, -1):
for j in range(i, 99, -1):
num = i * j
if num > max_ and is_palindrome(num, 10):
max_ = num
end = default_timer()
print('Project Euler, Problem 4')
print('Answer: {}'.format(max_))
print('Elapsed time: {:.9f} seconds'.format(end - start))
if __name__ == '__main__':
main()