MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / compute

Function compute

projects/ProjectEuler/Problem 9/p9.py:1–8  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1def compute():
2 PERIMETER = 1000
3 for a in range(1, PERIMETER + 1):
4 for b in range(a + 1, PERIMETER + 1):
5 c = PERIMETER - a - b
6 if a * a + b * b == c * c:
7 # It is now implied that b < c, because we have a > 0
8 return str(a * b * c)
9
10
11if __name__ == "__main__":

Callers 1

p9.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected