loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
import itertools

word = "mississippi"
length = 3

all_permutations = set(["".join(x) for x in itertools.permutations(word, length)])

print("For word '{}'".format(word))
for l in range(1, length + 1):
  perm = set([x for x in all_permutations if len(set(list(x))) == l])
  print(" . . words with", l, "letters =", len(perm))