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

Explica este código Python

Dificultad: Fácil

x = {"pepe", "albert", "jacinto", "alba"}
print(x[1])
Enter fullscreen mode
Exit fullscreen mode

👉 A. pepe
👉 B. albert
👉 C. jacinto
👉 D. TypeError


Respuesta:

👉 D. TypeError

Los conjuntos son una estructura de datos de Python que se caracterizan por no indexar sus elementos, por ende no es posible acceder a un valor especifico de un conjunto mediante su índice (cosa que si se puede hacer con listas y tuplas).


Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Our affordable cloud storage services are designed to provide high quality solutions without breaking the bank. Portainer docker compose. Privacy, cookie & data policy.