DEV Community

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

Posted on

1

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

Explica este código Python

Dificultad: Intermedio

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

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

Respuesta:

👉 C. {1, 2, 4, 5}

En nuestro ejemplo la diferencia simétrica consiste en extraer todos los elementos que esten en x o y pero que no este en ambos.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more