Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # fast_combo_unique.py
- from itertools import combinations
- def combine(zeros=3, ones=2):
- for indices in combinations(range(zeros+ones), ones):
- item = ['0'] * (zeros+ones)
- for index in indices:
- item[index] = '1'
- yield ''.join(item[::-1])
- for z in combine(3, 2):
- print z,
- '00011 00101 01001 10001 00110 01010 10010 01100 10100 11000'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement