I'm trying to get my python feet wet on Project Euler, but I have a problem with the first problem (find the sum of multiples of 3 or 5 to 1000). I can successfully print multiple of three and five, but when I try to enable the sum function, I get the following error:
TypeError: object 'int' is not iterable
Any help would be greatly appreciated.
n = 100
p = 0
while p<n:
p = p + 1
x = range(0, p)
def numcheck(x):
for numbers in x:
if numbers%3==0 and numbers%5==0:
sum(numbers)
numcheck(x)
source
share