MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / mulitples

Function mulitples

project_euler/problem_01/sol4.py:1–23  ·  view source on GitHub ↗
(limit)

Source from the content-addressed store, hash-verified

1def mulitples(limit):
2 xmulti = []
3 zmulti = []
4 z = 3
5 x = 5
6 temp = 1
7 while True:
8 result = z * temp
9 if (result < limit):
10 zmulti.append(result)
11 temp += 1
12 else:
13 temp = 1
14 break
15 while True:
16 result = x * temp
17 if (result < limit):
18 xmulti.append(result)
19 temp += 1
20 else:
21 break
22 collection = list(set(xmulti+zmulti))
23 return (sum(collection))
24
25
26

Callers 1

sol4.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected