How to create an empty dictionary in Python

Опубликовано: 04 Октябрь 2024
на канале: Enthought
5,848
24

In this short tutorial, you will learn how to create an empty dictionary in Python, and use Python's bytecode disassembler to understand why the literal syntax is faster than the constructor. Want to learn more? See our Python classes at https://goo.gl/T9QNuW.

Read the documentation for dictionaries here: https://docs.python.org/3/library/std...

Code from video:
*****************
{}
dict()
import dis
dis.dis('{}')
dis.dis('dict()')

Connect with us!
*****************
  / enthought  
  / enthought  
  / enthought