f0rmull

Untitled

Jun 15th, 2022
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import itertools
  2.  
  3.  
  4. key  = 'GEORIY'
  5.  
  6. cnt = 0
  7. for item in itertools.product(key,repeat = 7):
  8.     s = ''.join(item)
  9.     g = s.count('G')
  10.     e = s.count('E')
  11.     o = s.count('O')
  12.     r = s.count('R')
  13.     i = s.count('I')
  14.     y = s.count('Y')
  15.     if g == 2 and  e == 1 and o == 1 and r == 1 and i == 1 and y ==1:
  16.         if s.count('GG') == 0:
  17.             cnt = cnt + 1
  18. print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment