Last active
June 25, 2025 00:48
-
-
Save imazine/6e0c1fd45015141307fb4645db5b6e09 to your computer and use it in GitHub Desktop.
Cartersian product in Python
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
from itertools import product | |
alist = [[1,2], [3], [4,5,6]] | |
def cartersian(l): | |
return list(product(*l)) | |
cartersian(alist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment