Browse Source
Merge pull request #9 from crazyiop/dict-del
dict: add del operator
pull/10/head
Jure Šorn
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
0 deletions
-
README.md
|
|
@ -61,6 +61,7 @@ Dictionary |
|
|
|
``` |
|
|
|
|
|
|
|
```python |
|
|
|
del <dict>[key] # Remove an existing key. |
|
|
|
value = <dict>.get(key, default) # Returns default if key does not exist. |
|
|
|
value = <dict>.setdefault(key, default) # Same, but also adds default to dict. |
|
|
|
<dict> = collections.defaultdict(<type>) # Creates a dictionary with default value of type. |
|
|
|