戯言SE

Python | 空の辞書を作成する方法

Python
2018.06.172018.07.18

iPython

In [1]: {}
Out[1]: {}

In [2]: dict()
Out[2]: {}

In [3]: import dis

In [4]: dis.dis('{}')
  1           0 BUILD_MAP                0
              2 RETURN_VALUE

In [5]: dis.dis('dict()')
  1           0 LOAD_NAME                0 (dict)
              2 CALL_FUNCTION            0
              4 RETURN_VALUE

Python
ProgrammingPython
戯言SE

関連記事

Python

Python | 空リストを作成する方法

Python

Python | キーから値を取得する方法

Python

Python | 辞書に項目を追加する方法

Portfolio

Python | 辞書を空にする方法

Python

Python | 重複した項目をリストから削除する方法

Python

Python | リストが空であるかどうかをチェックする方法

Python | 辞書の値を変更する方法
Python | 辞書から項目を削除する方法
ホーム
Programming
Python
戯言SE
© 1997 戯言SE.
  • ホーム
  • トップ