Created
March 31, 2014 20:56
-
-
Save stlehmann/9902057 to your computer and use it in GitHub Desktop.
Find all combinations of two lists
This file contains 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
>>> import itertools | |
>>> list_1 = [1, 2, 3] | |
>>> list_2 = [4, 5, 6] | |
>>> list(itertools.product(list_1, list_2)) | |
[(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5), (3, 6)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment