Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Last active July 30, 2019 05:03
Show Gist options
  • Save ChaitanyaBaweja/2e1ef221567761acc65c5542adfab8ee to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/2e1ef221567761acc65c5542adfab8ee to your computer and use it in GitHub Desktop.
a = [1,2,3,4]
b = [10, 11]
cart_prod = [(i,j) for i in a for j in b]
print cart_prod
# Output:
# [(1, 10), (1, 11), (2, 10), (2, 11), (3, 10), (3, 11), (4, 10), (4, 11)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment