title: python input for itertools.product
body: <p>Looking for a way to simulate nested loops (or a cartesian product) i came across the itertools.product function. 
  i need a function or piece of code that receive a list of integers as input and returns a specific generator.  </p>
  
  <p>example:<br>
  input = [3,2,4] -> gen = product(xrange(3),xrange(2),xrange(4))<br>
  or<br>
  input = [2,4,5,6] -> gen = product(xrange(2),xrange(4),xrange(5),xrange(6))  </p>
  
  <p>as the size of the lists varies i am very confused in how to do that without the need of a lot of precoding based on a crazy amount of ifs and the size of the list.</p>
  
  <p>also is there a difference in calling product(range(3)) or product(xrange(3))?</p>