Skip to content

Instantly share code, notes, and snippets.

@zahash
Created January 5, 2019 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zahash/9769fb332c82431d43e93c34e12a17d0 to your computer and use it in GitHub Desktop.
Save zahash/9769fb332c82431d43e93c34e12a17d0 to your computer and use it in GitHub Desktop.
def cartesian_product(x,y):
'''
This function will take two iterables and returns
the cartesian product of them as a list
'''
return [a+b for a in x for b in y]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment