import os 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))