DEV Community

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

Posted on

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

Explica este código Python

Dificultad: Fácil

q = [47, 28, 33, 54, 15]
q.reverse()
print(q[:3])
Enter fullscreen mode Exit fullscreen mode
  • A. [33, 54, 15]
  • B. [47, 28, 33]
  • C. [33, 28, 47]
  • D. [15, 54, 33]

Respuesta:

👉 D. [15, 54, 33]

reverse da la vuelta a la lista y luego cortamos la lista desde el índice 0 hasta el índice 2 y eso es lo que regresamos.

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more