Product


#1

What's wrong with that?
def product(numbers):
goal=1
for i in numbers:
if i==numbers:
goal*=numbers
return goal


#2

can you explain why you used this code:

if i==numbers:

i contain values from the list, numbers is the list. Integers and list do never equal each other


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.