When I run this code I don\'t get all the possible combinations of 3 characters:
def comb(iterable, r): pool = tuple(iterable) n = len(pool) for
You're looking for itertools.product(characters, repeat = 3).
itertools.product(characters, repeat = 3)
See the itertools.product docs.
>>> ' '.join(''.join(x) for x in itertools.product('abcd', repeat = 2)) aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd