+ 1

How do generate permutations of a given word?

I want to make list of words based on permutation of a given word.

24th Mar 2018, 12:59 PM
Brian Tomas
Brian Tomas - avatar
1 Answer
+ 3
word = input() from itertools import permutations lst =[x for x in permutations (word)] Use permutations function from itertools module.
24th Mar 2018, 1:32 PM
Vivek Sivaramakrishnan
Vivek Sivaramakrishnan - avatar