def product(integer): prod = 0 x = ' '.split(integer) print x #for y in x: # y += 1 integer([1, 2, 3]) #y is the iterator. it goes up every time an item in x is multiplied with another item in x. Each item will be subsequently added to prod, as an integer.
Does your product function take exactly one argument (a list of numbers)? Your code threw a "expected a string or other character buffer object" error.
So, I’m trying to split the list above to get a string of numbers, but I’m guessing (based on the error) that it wants a string? I dunno for sure, thought I’d check with you guys.