Popular recipes tagged "cartesian_product"http://code.activestate.com/recipes/tags/cartesian_product/popular/2010-10-01T00:40:26-07:00ActiveState Code RecipesRecursive function to replace nested for loops (cartesian product) (Python) 2010-10-01T00:40:26-07:00Kieranhttp://code.activestate.com/recipes/users/4175132/http://code.activestate.com/recipes/577415-recursive-function-to-replace-nested-for-loops-car/ <p style="color: grey"> Python recipe 577415 by <a href="/recipes/users/4175132/">Kieran</a> (<a href="/recipes/tags/cartesian_product/">cartesian_product</a>, <a href="/recipes/tags/code/">code</a>, <a href="/recipes/tags/for_loop/">for_loop</a>, <a href="/recipes/tags/python/">python</a>). Revision 3. </p> <p>Same functionality as the itertools product method (<a href="http://docs.python.org/library/itertools.html#itertools.product" rel="nofollow">http://docs.python.org/library/itertools.html#itertools.product</a>) with one major difference: generators are executed as the loop executes. An itertools product causes all the variables to be collected before the loop actually starts looping.</p>