Adopted new convention from template

This commit is contained in:
David Doblas Jiménez 2022-09-22 09:06:09 +02:00
parent 682ee755d2
commit fbaeeed8f3

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
"""
Created on 1 Jan 2018
@ -20,15 +20,15 @@ def compute():
Work out the first ten digits of the sum of the following one-hundred
50-digit numbers.
"""
file = Path("../files/Problem13.txt")
with open(file, "r") as f:
_file = Path("../files/Problem13.txt")
with open(_file, "r") as f:
num = f.readlines()
result = 0
ans = 0
for line in num:
result += int(line)
return str(result)[:10]
ans += int(line)
return str(ans)[:10]
if __name__ == "__main__":
print(f"Result for Problem 13: {compute()}")
print(f"Result for Problem 13 is {compute()}")