Created
April 2, 2024 09:02
-
-
Save ChekeGT/f223977b720f9c62725521f90de8524e to your computer and use it in GitHub Desktop.
Funcion que retorna el producto cartesiano de dos conjuntos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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