Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- def check(t):
- for e in ["11", "1000", "0010", "0000", "010", "0001", "1001", "0011", "0111"]:
- if e.startswith(t) or t.startswith(e):
- return False
- return True
- for i in range(1, 5):
- # перебор кодов
- for t in product("01", repeat=i):
- code = "".join(t)
- if check(code):
- print(code)
Advertisement
Add Comment
Please, Sign In to add comment