get all combination of binary 0 and 1 code example Example: numpy combinations of 5 bits import itertools lst = list(itertools.product([0, 1], repeat=3))