Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Last active July 30, 2019 05:04
Show Gist options
  • Save ChaitanyaBaweja/f7f3a328909dcc072a5480e8ae949605 to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/f7f3a328909dcc072a5480e8ae949605 to your computer and use it in GitHub Desktop.
a= [1,2,3,4]
b = [10,11]
cart_prod = []
for i in a:
for j in b:
cart_prod.append((i,j))
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