[ create a new paste ] login | about

Link: http://codepad.org/b8cSwMYH    [ raw code | output | fork ]

tenten321 - Python, pasted on Dec 10:
1
2
3
4
5
6
7
8
9
10
naturals = range(1,1000)

total = 0

for n in naturals:
  if n % 3 == 0 or n % 5 == 0:
    #print n
    total += n

print "Total:", total


Output:
1
Total: 233168


Create a new paste based on this one


Comments: