This commit is contained in:
David Doblas Jiménez
2021-09-20 17:53:15 +02:00
parent ad6c4e4cd2
commit 7c8165d9c2
50 changed files with 2264 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python3
"""
Created on 1 Jan 2018
@author: David Doblas Jiménez
@email: daviddoji@pm.me
Solution for problem 13 of Project Euler
https://projecteuler.net/problem=13
"""
from utils import timeit
@timeit("Problem 13")
def compute():
"""
Work out the first ten digits of the sum of the following one-hundred
50-digit numbers.
"""
with open("../files/Problem13.txt", "r") as f:
num = f.readlines()
result = 0
for line in num:
result += int(line)
return str(result)[:10]
if __name__ == "__main__":
print(f"Result for Problem 13: {compute()}")