DEV Community

Cristian Fernando
Cristian Fernando

Posted on • Edited on

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

Explica este código Python

Dificultad: Básico

numbers = [12, 5, 8, 13, 4]
num = numbers[::2]
print(num)
Enter fullscreen mode Exit fullscreen mode
  • A. [12, 8, 4]
  • B. [5, 13]
  • C. [4, 8, 12]
  • D. [4, 13, 8, 5, 12]

Respuesta en el primer comentario.

Top comments (1)

Collapse
 
duxtech profile image
Cristian Fernando • Edited

Respuesta:

  • A. [12, 8, 4]

Al momento de parcelar la lista omitimos los parámetros de inicio y final por lo que operaremos sobre toda la lista haciendo saltos de 2 en 2: [12, 8, 4]

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay