I would like to find a clean and clever way (in python) to find all permutations of strings of 1s and 0s x chars long. Ideally this would be fast and not require doing too m
itertools.product is made for this:
itertools.product
>>> import itertools >>> ["".join(seq) for seq in itertools.product("01", repeat=2)] ['00', '01', '10', '11'] >>> ["".join(seq) for seq in itertools.product("01", repeat=3)] ['000', '001', '010', '011', '100', '101', '110', '111']