Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import *
- count = 0
- A = []
- for elem in product("ПРОСТО", repeat = 6):
- if elem.count("П") == 1 and elem.count("Р") == 1 and elem.count("О") == 2 and elem.count("С") == 1 and elem.count("Т") == 1:
- for i in range(len(elem)):
- s =''
- s += elem[i]
- A.append(s)
- for i in range(len(A)):
- if 'ОО' not in A[i]:
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment