howto handle nested for

Ian Kelly ian.g.kelly at gmail.com
Fri Sep 28 12:00:02 EDT 2012


On Sep 28, 2012 9:49 AM, "Ian Kelly" <ian.g.kelly at gmail.com> wrote:
> levels = 6
> for combination in itertools.product(xrange(n_syms), levels):
>     # do stuff

Sorry, that should have read "product(xrange(n_syms), repeat=levels)". The
repeat argument is keyword-only.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120928/bb66389b/attachment.html>


More information about the Python-list mailing list