Permutations between lists

Hi,

How could I achieve this? From two separate lists, obtain the list of permutations but with each pair stored in a different tree branch.

However, the order matters, I want to first pick an item from the first list (example, 1) and then go through the second list (example, a, b, c, d) to generate 1a, 1b, 1c, 1d. Only then jump to the second item of the first list (2) to generate 2a, 2b, 2c, 2d and so on.

Thanks!

Oops I misread your post. Anyway.

Thanks a lot! Quite simple actually!

__author__ = "Joseph Oster"
__version__ = "2021.06.06"

from itertools import permutations  

perm = permutations(vals, len(vals))
perms = []
for c in list(perm): 
    perms.append("+".join(c))

P = perms