title: Getting index out of range error when trying to pass a for loop through a list
body: <p>The challenge is to compute the product of the elements in a list without using the range function.</p>
  
  <p>Here is my program:</p>
  
  <pre><code>def prod(L):
      a = 1
      for i in L:
          a *= L[i] 
      return a
  </code></pre>
  
  <p>I am pretty sure that when I write the for loop, it should iterate through the list, but when I run this program, I get the error that index is out of range. Why is this happening? How can I change the program to make it work?</p>
  
  <p>Thanks in advance for your replies!</p>