Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # next_combo.py
- def next_combo(values):
- j = [[]]
- for value in values:
- L = len(j)
- j += [i + [value] for i in j]
- for result in j[L:]:
- yield result
- values = [1,2,3,4,5,6]
- combo = next_combo(values)
- while 1:
- try:
- print next(combo)
- except:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement