I need a function generateAllStrings(n, alphabet)
to do something like this:
generateAllStrings(4, ['a','b'])
>>> ["aaaa", "aaab", "aaba", "aabb", "abaa", .... , "bbba", "bbbb"]
In other words, generateAllStrings(n, alphabet)
should return all the possible strings of length n over the chars in the list alphabet.
Is there such a function in itertools or something?