title: Adding the product of an element of a list to an existing list in Python
body: <p>I am trying to take a list of lists (like shown below)</p>
  
  <pre><code>list = [[7, 3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3],
          [3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0],
          [1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6],
          [6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6, 2],
          [7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6, 2, 4]]
  </code></pre>
  
  <p>compute the product of all the elements of each list, and append the result back onto the original list. </p>
  
  <p>So, for example, if I were to take the list I posted above, what I would want it to look like is this:</p>
  
  <pre><code>list_2 = [[5000940,[7, 3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3]],
            [0,[3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0]],
            [0,[1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6]],
            [0,[6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6, 2]],
            [0,[7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6, 2, 4]]]
  </code></pre>
  
  <p>The code that I have written so far takes in the list, outputs the products, but unfortunately I can't seem to get it properly appended to the exiting list and I was hoping someone would be able to show me how to do this.</p>
  
  <pre><code>for i in range(len(list)):
      global products
      products = []
      list_prod = reduce(mul, list[i], 1)
      #products.append(list_prod)
      print products
  </code></pre>