Skip to content

Commit 10b0a40

Browse files
author
Christian Bender
committed
fixed solution 4 of problem 1
1 parent a2b540f commit 10b0a40

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Project Euler/Problem 01/sol4.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def mulitples(limit):
99
if (result < limit):
1010
zmulti.append(result)
1111
temp += 1
12-
continue
1312
else:
1413
temp = 1
1514
break
@@ -18,15 +17,14 @@ def mulitples(limit):
1817
if (result < limit):
1918
xmulti.append(result)
2019
temp += 1
21-
continue
2220
else:
23-
temp = 1
2421
break
25-
return (sum(zmulti) + sum(xmulti))
22+
collection = list(set(xmulti+zmulti))
23+
return (sum(collection))
2624

2725

2826

2927

3028

3129

32-
print (mulitples(100))
30+
print (mulitples(1000))

0 commit comments

Comments
 (0)