3 ms·
Yeah, a list comprehension is the easiest way to write it in any of the languages. I think it's a little clearer/shorter to do print sum(x for x in range(1, 1
by Fishkins 13y ago
Yeah, a list comprehension is the easiest way to write it in any of the languages. I think it's a little clearer/shorter to do
print sum(x for x in range(1, 1000) if x % 3 == 0 or x % 5 == 0)