Skip to content

Instantly share code, notes, and snippets.

@ChekeGT
Created April 2, 2024 09:02
Show Gist options
  • Save ChekeGT/f223977b720f9c62725521f90de8524e to your computer and use it in GitHub Desktop.
Save ChekeGT/f223977b720f9c62725521f90de8524e to your computer and use it in GitHub Desktop.
Funcion que retorna el producto cartesiano de dos conjuntos
def producto_cartesiano(conjunto1, conjunto2):
conjunto1 = list(conjunto1)
conjunto2 = list(conjunto2)
conjunto_producto_cartesiano = []
for elemento1 in conjunto1:
for elemento2 in cojunto2:
conjunto_producto_cartesiano.append([elemento1, elemento2])
return conjunto_producto_cartesiano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment