I used a slightly simpler method, but essentially did the same thing:
total = 0
for n in range(3,1000):
if n % 3 == 0:
total += n
elif n % 5 == 0:
total += n
print total
The elif
makes sure that you only count any factor/divisor once.