Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- key = 'GEORIY'
- cnt = 0
- for item in itertools.product(key,repeat = 7):
- s = ''.join(item)
- g = s.count('G')
- e = s.count('E')
- o = s.count('O')
- r = s.count('R')
- i = s.count('I')
- y = s.count('Y')
- if g == 2 and e == 1 and o == 1 and r == 1 and i == 1 and y ==1:
- if s.count('GG') == 0:
- cnt = cnt + 1
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment