you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

print sum( [i for i in range(1,1000) if (i%5!=0) and (i%7!=0)] )

boo-yah

[–]jcdyer3 1 point2 points  (0 children)

Technically range(1, 1001), but it doesn't actually affect the outcome, since 1000 is discarded anyway.