Fix path
This commit is contained in:
parent
720668c101
commit
d7d41fc4fb
@ -9,6 +9,7 @@ Solution for problem 42 of Project Euler
|
|||||||
https://projecteuler.net/problem=42
|
https://projecteuler.net/problem=42
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
from utils import timeit
|
from utils import timeit
|
||||||
|
|
||||||
|
|
||||||
@ -37,7 +38,9 @@ def compute():
|
|||||||
|
|
||||||
triangular_numbers = [triangle_number(n) for n in range(27)]
|
triangular_numbers = [triangle_number(n) for n in range(27)]
|
||||||
ans = 0
|
ans = 0
|
||||||
with open("files/Problem42.txt", "r") as f:
|
|
||||||
|
file = Path("/datos/Scripts/Gitea/Project_Euler/src/files/Problem42.txt")
|
||||||
|
with open(file, "r") as f:
|
||||||
words = f.readline().strip('"').split('","')
|
words = f.readline().strip('"').split('","')
|
||||||
for word in words:
|
for word in words:
|
||||||
if word_to_value(word) in triangular_numbers:
|
if word_to_value(word) in triangular_numbers:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user