How can I get pairs of values, where the first is taken from one list and the second from another list? [duplicate]

These are not really “combinations” in the sense of combinatorics. These are rather elements from the Cartesian product of a and b. The function in the standard library to generate these pairs is itertools.product():

for i, j in itertools.product(a, b):
    # Whatever

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)