Skip to content

Instantly share code, notes, and snippets.

@r-k-b
Created September 26, 2017 03:09
Show Gist options
  • Select an option

  • Save r-k-b/695d84e38f1e28acaf8f5494fcb16bec to your computer and use it in GitHub Desktop.

Select an option

Save r-k-b/695d84e38f1e28acaf8f5494fcb16bec to your computer and use it in GitHub Desktop.
Quickly enumerate a human-readable Cartesian Product for some choices.
import itertools
somelists = [
[
'There is no last-seen catalog for this product',
'The last-seen category is the same as the current category',
'The last-seen category is different to the current category',
],
[
'The last-seen category matches to a BigCommerce category',
'The last-seen category does not match to a BigCommerce category',
],
[
'The current category matches to a BigCommerce category',
'The current category does not match to a BigCommerce category',
],
[
'The BigCommerce product has the last-seen category',
'The BigCommerce product does not have the last-seen category',
],
[
'The BigCommerce product has the current category',
'The BigCommerce product does not have the current category',
],
]
for element in itertools.product(*somelists):
print(element)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment