SyntaxFix
Write A Post
Hire A Developer
Questions
itertools is ideally suited for this:
itertools
itertools.chain.from_iterable((''.join(l) for l in itertools.product(charset, repeat=i)) for i in range(1, maxlen + 1))