Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 11, 2019 22:51
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 parzibyte/47ac606fdde1e80d9579859c3068667e to your computer and use it in GitHub Desktop.
Save parzibyte/47ac606fdde1e80d9579859c3068667e to your computer and use it in GitHub Desktop.
animales_terrestres = set(["Tortuga", "Lobo", "Perro", "Cangrejo"])
print("Terrestres: ", animales_terrestres)
animales_acuaticos = set(["Tiburón", "Pulpo", "Tortuga", "Cangrejo"])
print("Acuáticos: ", animales_acuaticos)
animales_unicamente_terrestres = animales_terrestres.difference(animales_acuaticos)
print("Diferencia: ", animales_unicamente_terrestres)
# También usando el operador -
animales_unicamente_terrestres = animales_terrestres - animales_acuaticos
print("Diferencia con -: ", animales_unicamente_terrestres)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment