1 2 3 4 5
def allstrings(alphabet): yield '' for astring in allstrings(alphabet): for letter in alphabet: yield astring + letter