Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- alphabet, n = [i for i in input()], int(input())
- words, c = [i for i in product(alphabet, repeat=n) if i.count(alphabet[0]) > 1], 0
- for i in words:
- for j in i:
- print(j, end="")
- c += 1
- print()
- print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement