Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python generate tuple from lists

# you may want to check itertools.product
from itertools import product
l1 = [0, 1]
l2 = [2, 3]
for x in product(l1, l2, repeat = 1):
    print(x)
>>>
(0, 2)
(0, 3)
(1, 2)
(1, 3)
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #generate #tuple #lists
ADD COMMENT
Topic
Name
8+5 =