Skip to content

Commit 5c1e924

Browse files
committed
Dictionary
1 parent c2da828 commit 5c1e924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ Dictionary
6161
```
6262

6363
```python
64-
del <dict>[key] # Remove an existing key.
6564
value = <dict>.get(key, default) # Returns default if key does not exist.
6665
value = <dict>.setdefault(key, default) # Same, but also adds default to dict.
6766
<dict> = collections.defaultdict(<type>) # Creates a dictionary with default value of type.
6867
<dict> = collections.defaultdict(lambda: 1) # Creates a dictionary with default value 1.
6968
```
7069

7170
```python
71+
del <dict>[key]
7272
<dict>.update(<dict>)
7373
<dict> = dict(<list>) # Initiates a dict from list of key-value pairs.
7474
<dict> = dict(zip(keys, values)) # Initiates a dict from two lists.

0 commit comments

Comments
 (0)