DEV Community

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

Posted on • Edited on

1

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

Explica este código Python

Dificultad: Fácil

mi_lista = [True, "hi", "bye", (1,2,3), {"1": "uno"}]
mi_lista.clear()
print(mi_lista)
Enter fullscreen mode Exit fullscreen mode

👉 A. ()
👉 B. []
👉 C. {}
👉 D. SyntaxError


Respuesta:

👉 B. []

La manera mas sencilla de eliminar todos los items de una lista es usando la función clear().

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