Last active
February 12, 2023 10:17
-
-
Save blacknon/f81cf3d3aad1c512b4c12983fc6ddbce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- encoding: UTF-8 -*- | |
import itertools | |
options = { | |
"x": ["a", "b"], | |
"y": [10, 20, 30]} | |
keys = options.keys() | |
values = (options[key] for key in keys) | |
combinations = [dict(zip(keys, combination)) for combination in itertools.product(*values)] | |
print(combinations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment