This is my code:
def product(intList): total = 1 for i in intList: total = total * i return total
It doesn’t work and I get an indentation error on line 3. However, in the Code Academy answers:
def product(list): total = 1 for num in list: total = total * num return total
It seems like almost exactly the same code, just with different names, but it works! Why is this? Does it have to do something with list? I noticed that in the Code Academy answers, list has white text, whereas my variable name was red, just like any other. Does that have something to do with it?
All help is appreciated, thank you!