18 lines
261 B
Python
18 lines
261 B
Python
import os
|
|
|
|
|
|
# Find the sum of all number that are divisible by either 3 or 5 below 1000
|
|
|
|
threes = set()
|
|
fives = set()
|
|
|
|
for x in range(334):
|
|
threes.add(3*x)
|
|
|
|
for x in range(200):
|
|
fives.add(5*x)
|
|
|
|
|
|
threesfives = threes.union(fives)
|
|
|
|
print(sum(threesfives)) |