MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_099/sol1.py:20–32  ·  view source on GitHub ↗

>>> solution() 709

(data_file: str = "base_exp.txt")

Source from the content-addressed store, hash-verified

18
19
20def solution(data_file: str = "base_exp.txt") -> int:
21 """
22 >>> solution()
23 709
24 """
25 largest: float = 0
26 result = 0
27 for i, line in enumerate(open(os.path.join(os.path.dirname(__file__), data_file))):
28 a, x = list(map(int, line.split(",")))
29 if x * log10(a) > largest:
30 largest = x * log10(a)
31 result = i + 1
32 return result
33
34
35if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected