[Solved] The Concept Behind itertools’s product Function


This code should do the work:

bytes = [i for i in range(2**(n))]
AB= []
for obj in bytes:
    t = str(bin(obj))[2:]
    t="0"*(n-len(t)) + t
    AB.append(t.replace('0','A').replace('1','B'))

n being the string size wanted

solved The Concept Behind itertools’s product Function