I am attempting to call and define a function within a for loop in Python. I have looked through the internet and have not found a way to solve this. I decided to give it a shot and was not successful.
Here is my code:
product = 1
for number in numbers:
product = product * numbers
Here is the error:
TypeError: 'function' object is not iterable on line 4
Could someone please point out my error and how to fix my code?
Replace this line with your code.