I want to find all possible permutation of two list of strings within a constant length (5). Assume list_1 = ["A"] and list_2 = ["BB"].
All possible combinations are:
A A A A A
A A A BB
A A BB A
A BB A A
BB A A A
A BB BB
BB A BB
BB BB A
I was trying to implement it with the code below, but I am not sure how to define the length 5 for it.
import itertools
from itertools import permutations
list_1 = ["A"]
list_2 = ["BB"]
unique_combinations = []
permut = itertools.permutations(list_1, 5)
for comb in permut:
zipped = zip(comb, list_2)
unique_combinations.append(list(zipped))
print(unique_combinations)