When I do:
l = [] for i in range(10): if i%3 == 0 or i%5 == 0: l.append[i] print sum(l)
I get
Traceback (most
append is a method, you use function call syntax.
append
l.append(i)
Also, more elegant approach in cases like this is to use list comprehension:
l = [i for i in range(10) if i % 3 == 0 or i % 5 == 0]