Quick nested loop syntax?

Tim Chase python.list at tim.thechases.com
Wed Nov 19 19:00:53 CET 2008


> if I remember correctly, wasn't there a way to quickly iterate through
> nested loops? Something like
> 
> a = { "a", "b", "c" }
> b = { 4, 9, 13}
> for (x, y) in someoperator(a, b):
> 	print(x, y)

You may be reaching for this thread:

http://mail.python.org/pipermail/python-list/2008-January/473650.html

where I offered this:

http://mail.python.org/pipermail/python-list/2008-January/473671.html

There were several other solutions -- be sure to pick your 
favorite accordingly.

-tkc






More information about the Python-list mailing list