DEV Community

Cristian Fernando
Cristian Fernando

Posted on • Edited on

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

Explica este código Python

Dificultad: Intermedio

## Reto #43
lista_compras = ["huevos", "pan", "tomates", "leche"]
print(lista_compras[100:200:50])
Enter fullscreen mode Exit fullscreen mode
  • A. IndexError
  • B. SyntaxError
  • C. TypeError
  • D. []

Respuesta en el primer comentario.

Top comments (1)

Collapse
 
duxtech profile image
Cristian Fernando • Edited

Respuesta:

  • D. []

Cuando intentamos acceder a una porción que no existe en una lista quizá pienses que deberíamos ver un error por consola, pero la verdad es que solo veremos un arreglo vacío haciendo referencia a que dicha porción de la lista justamente esta vacía.

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay