Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 731d73f

Browse files
committedSep 9, 2021
[mypy] fix type annotations for project euler problem099/sol1
1 parent 881b318 commit 731d73f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎project_euler/problem_099/sol1.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ def solution(data_file: str = "base_exp.txt") -> int:
2222
>>> solution()
2323
709
2424
"""
25-
largest = [0, 0]
25+
largest: float = 0
26+
result = 0
2627
for i, line in enumerate(open(os.path.join(os.path.dirname(__file__), data_file))):
2728
a, x = list(map(int, line.split(",")))
28-
if x * log10(a) > largest[0]:
29-
largest = [x * log10(a), i + 1]
30-
return largest[1]
29+
if x * log10(a) > largest:
30+
largest = x * log10(a)
31+
result = i + 1
32+
return result
3133

3234

3335
if __name__ == "__main__":

0 commit comments

Comments
 (0)
Please sign in to comment.