I want to generate a list of tuples of all possible combinations of 0/1 of size n=16, but where some positions are fixed. So some positions are fixed a 0 or 1 (x,x,x,x,1,x,x,x,0,0,x,x,x,x,x,x). I know we can use itertools to generate all possible combinations without any fixed places:
import itertools
permutations = list(itertools.product([0, 1], repeat=16))
I was thinking of generating all combinations with repeat=13 and then inserting the fixed places, but this seems too cumbersome to me. Are there easier and faster ways to achieve this?