DEV Community

Cover image for Ibuprofeno.py💊| #133: Explica este código Python
Cristian Fernando
Cristian Fernando

Posted on

1

Ibuprofeno.py💊| #133: Explica este código Python

Explica este código Python

Dificultad: Fácil

x = {1, 2, 3}
y = {3, 4, 5}

print(x.union(y))
Enter fullscreen mode Exit fullscreen mode
  • A. {}
  • B. {1, 2, 3, 4, 5}
  • C. {3}
  • D. {1, 2, 4, 5}

Respuesta:

👉 B. {1, 2, 3, 4, 5}

La unión de conjuntos consiste en tomar todos los items tanto del conjunto x como del conjunto y. Obviamente esto sin repetir items.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more