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

Function solution

project_euler/problem_040/sol1.py:18–41  ·  view source on GitHub ↗

Returns >>> solution() 210

()

Source from the content-addressed store, hash-verified

16
17
18def solution():
19 """Returns
20
21 >>> solution()
22 210
23 """
24 constant = []
25 i = 1
26
27 while len(constant) < 1e6:
28 constant.append(str(i))
29 i += 1
30
31 constant = "".join(constant)
32
33 return (
34 int(constant[0])
35 * int(constant[9])
36 * int(constant[99])
37 * int(constant[999])
38 * int(constant[9999])
39 * int(constant[99999])
40 * int(constant[999999])
41 )
42
43
44if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected