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

Function solution

project_euler/problem_033/sol1.py:60–68  ·  view source on GitHub ↗

Return the solution to the problem

(n: int = 2)

Source from the content-addressed store, hash-verified

58
59
60def solution(n: int = 2) -> int:
61 """
62 Return the solution to the problem
63 """
64 result = 1.0
65 for fraction in fraction_list(n):
66 frac = Fraction(fraction)
67 result *= frac.denominator / frac.numerator
68 return int(result)
69
70
71if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

fraction_listFunction · 0.85

Tested by

no test coverage detected