This content originally appeared on DEV Community and was authored by Cristian Fernando
Explica este código Python
Dificultad: Fácil
print(set([1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]))
-
A.
{0, 1, 2, 3, 4, 5}
-
B.
{1, 2, 3, 4, 5}
-
C.
{0, 1, 2, 3, 4}
-
D.
{}
Respuesta:
👉 B. {1, 2, 3, 4, 5}
¿Qué sucede si pasamos a la función set
una lista?
Elimina todos los duplicados y regresa un set
con los items no repetidos de la lista.
This content originally appeared on DEV Community and was authored by Cristian Fernando
Cristian Fernando | Sciencx (2024-06-25T11:00:00+00:00) Ibuprofeno.py💊| #124: Explica este código Python. Retrieved from https://www.scien.cx/2024/06/25/ibuprofeno-py%f0%9f%92%8a-124-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.