I met a problem, I need to create a list of all possible variations of string. I had already tried some methods from itertools, like [''.join(i) for i in itertools.permutations('abc')] or
(comb = [''.join(i) for i in itertools.combinations_with_replacement('abc',3)] but they have a bit different result, as i was expected. I need ALL variations, so permutation isn't the way to do it. Combinations with replacement were quite good, but there were missing some subsequence
The result of this operation is:
aab
aac
abb
abc
acc
bbb
bbc
bcc
ccc
But i need output 'aba', 'acb' 'bab',etc as well (Need to cover all possible variants) Maybe im missing another method in itertools, that would help me? Thanks for any help and advice