Daniele Fucini 3b597a8845
Add more python solutions
Added python solutions for problems 11, 12, 13, 14, 15
2019-09-19 16:54:12 +02:00

29 lines
523 B
Python

#!/usr/bin/python3
from timeit import default_timer
from projecteuler import count_divisors
def main():
start = default_timer()
i = 0
triang = 0
finished = 0
while not finished:
i = i + 1
triang = triang + i
if count_divisors(triang) > 500:
finished = 1
end = default_timer()
print('Project Euler, Problem 12')
print('Answer: {}'.format(triang))
print('Elapsed time: {:.9f} seconds'.format(end - start))
if __name__ == '__main__':
main()