mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
The key-value pairs can be lists or tuples or any iterable.
This commit is contained in:
parent
2c8600446d
commit
8699aeaf34
1 changed files with 1 additions and 1 deletions
|
|
@ -466,7 +466,7 @@ Here is a small example using a dictionary::
|
||||||
False
|
False
|
||||||
|
|
||||||
The :func:`dict` constructor builds dictionaries directly from sequences of
|
The :func:`dict` constructor builds dictionaries directly from sequences of
|
||||||
key-value pairs stored as tuples. ::
|
key-value pairs::
|
||||||
|
|
||||||
>>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])
|
>>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])
|
||||||
{'sape': 4139, 'jack': 4098, 'guido': 4127}
|
{'sape': 4139, 'jack': 4098, 'guido': 4127}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue