Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python loop nest shorthand

>>> from itertools import product
>>> 
>>> for x,y in product(range(3), range(4)):
...   print (x,y)
... 
(0, 0)
(0, 1)
(0, 2)
(0, 3)
(1, 0)
(1, 1)
(1, 2)
(1, 3)

... and so on
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #loop #nest #shorthand
ADD COMMENT
Topic
Name
9+9 =