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

Explica este código Python

Dificultad: Fácil

conjunto_vacio = {}
print(type(conjunto_vacio))
Enter fullscreen mode
Exit fullscreen mode
  • A. <class 'tuple'>
  • B. <class 'dict'>
  • C. <class 'set'>
  • D. <class 'str'>

Respuesta:

👉 B. <class 'dict'>

No es posible crear conjuntos vacios usando a notación de {}, para lograr esto es necesario usar la palabra reservada set, así:

conjunto_vacio = set({})
print(type(conjunto_vacio)) # <class 'set'>
Enter fullscreen mode
Exit fullscreen mode


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
The complete web developer course 2. Developer business website invogue nexus web design. Wajid it is a leading digital agency offering comprehensive website development and seo services.