DEV Community

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

Posted on • Edited on

2

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

Explica este código Python

Dificultad: Fácil

my_tuple = (12, 45, 78)
x, y, z, t = my_tuple
print(t)
Enter fullscreen mode Exit fullscreen mode

👉 A. 78
👉 B. ValueError
👉 C. 45
👉 D. 12


Respuesta:

👉 B. ValueError

Para poder desempaquetar tuplas es necesario que la cantidad de variables creadas sea igual a la longitud de la tupla per se. Si esto no pasa entonces tenemos un ValueError.

Top comments (0)

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

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay