Daniele Fucini cac80478da
Add more solutions
Added solutions for problems 36, 37, 38, 39 and 40 in python and C
2019-09-21 15:45:18 +02:00

24 lines
471 B
Python

#!/usr/bin/python3
from timeit import default_timer
from projecteuler import is_palindrome
def main():
start = default_timer()
sum_ = 0
for i in range(1, 1000000):
if is_palindrome(i, 10) and is_palindrome(i, 2):
sum_ = sum_ + i
end = default_timer()
print('Project Euler, Problem 36')
print('Answer: {}'.format(sum_))
print('Elapsed time: {:.9f} seconds'.format(end - start))
if __name__ == '__main__':
main()