Python tip 8: dict.fromkeys() method

Publicado el: 30 marzo 2022
en el canal de: learnbyexample
828
17

A lesser known way to create a dictionary is to use the `fromkeys()` method that accepts an iterable and an optional value (default is `None`).

Recent Python versions ensure that the insertion order is maintained for a dictionary. So, you can remove duplicate items from a list while maintaining the order by building a dictionary using the `fromkeys()` method and converting it back to a list.

This video is based on content from my "100 Page Python Intro" ebook: https://github.com/learnbyexample/100...


En esta página del sitio puede ver el video en línea Python tip 8: dict.fromkeys() method de Duración hora minuto segunda en buena calidad , que subió el usuario learnbyexample 30 marzo 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 828 veces y le gustó 17 a los espectadores. Disfruta viendo!