Skip to content

Commit 1568432

Browse files
Add files via upload
1 parent 54f6d1f commit 1568432

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: Project Euler/Problem 01/sol4.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
def 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+
continue
13+
else:
14+
temp = 1
15+
break
16+
while True:
17+
result = x * temp
18+
if (result < limit):
19+
xmulti.append(result)
20+
temp += 1
21+
continue
22+
else:
23+
temp = 1
24+
break
25+
return (sum(zmulti) + sum(xmulti))
26+
27+
28+
29+
30+
31+
32+
print (mulitples(100))

0 commit comments

Comments
 (0)