This content originally appeared on DEV Community and was authored by Cristian Fernando
Explica este código Python
Dificultad: Fácil
x = {1,2,3}
y = {3,4,5}
print(x.intersection(y))
-
A.
{1, 2, 4, 5} -
B.
{3} -
C.
{1, 2, 3, 4, 5} -
D.
Ninguna de las anteriores
Respuesta:
👉 B. {3}
La intersección entre conjuntos consiste en tomar solo los items que estén presentes en ambos conjuntos, en este caso el único valor que cumple con eso es el 3.
This content originally appeared on DEV Community and was authored by Cristian Fernando
Cristian Fernando | Sciencx (2024-07-04T11:00:00+00:00) Ibuprofeno.py💊| #132: Explica este código Python. Retrieved from https://www.scien.cx/2024/07/04/ibuprofeno-py%f0%9f%92%8a-132-explica-este-codigo-python/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.