Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- c = 0
- for i in itertools.permutations("МИТРОФАН", r = 6):
- i = ''.join(i)
- gcount = i.count('И') + i.count('А') + i.count('О')
- if gcount >= 3:
- continue
- f = False
- for j in itertools.product('ИОА', repeat=2):
- j = ''.join(j)
- if j in i:
- f = True
- break
- if f:
- continue
- c += 1
- print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement