dxnge

7

Oct 30th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. from itertools import permutations
  2. words = permutations('ОСЕНЬЮПРИЗЫВ')
  3. cnt = 0
  4. for i in words:
  5.     if all((i[n] in 'ОЕЬЮИЫ' and i[n+1] in 'ОЕЬЮИЫ') for n in range(0, 12, 4)):
  6.         if all((i[n] in 'СНПРЗВ' and i[n+1] in 'СНПРЗВ') for n in range(2, 12, 4)):
  7.             cnt += 2
  8.     #elif all((i[n] in 'ОЕЬЮИЫ' and i[n + 1] in 'ОЕЬЮИЫ') for n in range(2, 12, 4)):
  9.     #    if all((i[n] in 'СНПРЗВ' and i[n + 1] in 'СНПРЗВ') for n in range(0, 12, 4)):
  10.     #        print(i)
  11.     #        cnt += 1
  12. print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment