Python code for all combinations of part of a list?
<p>I have some code set up to where 2 consonants are randomly generated and 2 vowels are randomly generated, and each are assigned to their own individual variable. I used print (itertools.permutations(list)) to show all possible combinations of the 4 letters, with list being the variables of each vowel or consonant, but nothing happened. Is there an easier way to do this? Or am I just doing it wrong? </p>

<pre><code>In [34]: L = ['a', 'e', 'b', 'c']

In [35]: for p in itertools.permutations(L): print(''.join(p))
aebc
aecb
abec
abce
aceb
acbe
eabc
eacb
ebac
ebca
ecab
ecba
baec
bace
beac
beca
bcae
bcea
caeb
cabe
ceab
ceba
cbae
cbea
</code></pre>

python random permutation itertools