Advertisement
namemkazaza

X

Dec 8th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. from itertools import product
  2. alphabet, n = [i for i in input()], int(input())
  3. words, c = [i for i in product(alphabet, repeat=n) if i.count(alphabet[0]) > 1], 0
  4. for i in words:
  5.     for j in i:
  6.         print(j, end="")
  7.     c += 1
  8.     print()
  9. print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement