-
-
Save parzibyte/e663a6a927f28e85acc16eaf577278ef to your computer and use it in GitHub Desktop.
This file contains 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
animales_terrestres = set(["Tortuga", "Lobo", "Perro", "Cangrejo"]) | |
print("Terrestres: ", animales_terrestres) | |
animales_acuaticos = set(["Tiburón", "Pulpo", "Tortuga", "Cangrejo"]) | |
print("Acuáticos: ", animales_acuaticos) | |
diferencia_simetrica = animales_terrestres.symmetric_difference( | |
animales_acuaticos) | |
print("Diferencia simétrica: ", diferencia_simetrica) | |
# También usando el operador ^ | |
diferencia_simetrica = animales_terrestres ^ animales_acuaticos | |
print("Diferencia simétrica con ^: ", diferencia_simetrica) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment