RedKnight91

itertools.product values assigned back to iterators

Jul 2nd, 2021 (edited)
1,691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. combos = itertools.product(*ranges)
  2.  
  3. while True:
  4.     try:
  5.         combo = next(combos)
  6.         [r.set(combo[i]) for (i, r)  in enumerate(ranges)]
  7.     except StopIteration:
  8.         break
Advertisement
Add Comment
Please, Sign In to add comment