diff --git a/README.md b/README.md index 01a1006..7a3c684 100644 --- a/README.md +++ b/README.md @@ -86,9 +86,9 @@ value = .setdefault(key, default=None) # Returns and writes default if ``` ```python -value = .pop(key) # Removes item or raises KeyError. .update() # Adds items. Replaces ones with matching keys. -[k for k, v in .items() if v == value] # Returns list of keys that point to the value. +value = .pop(key) # Removes item or raises KeyError. +{k for k, v in .items() if v == value} # Returns set of keys that point to the value. {k: v for k, v in .items() if k in keys} # Returns dictionary filtered by keys. ``` diff --git a/index.html b/index.html index 6e21009..581941c 100644 --- a/index.html +++ b/index.html @@ -270,9 +270,9 @@ value = <dict>.setdefault(key, default=None# Creates a dict from two collections. <dict> = dict.fromkeys(keys [, value]) # Creates a dict from collection of keys. -
value = <dict>.pop(key)                         # Removes item or raises KeyError.
-<dict>.update(<dict>)                           # Adds items. Replaces ones with matching keys.
-[k for k, v in <dict>.items() if v == value]    # Returns list of keys that point to the value.
+
<dict>.update(<dict>)                           # Adds items. Replaces ones with matching keys.
+value = <dict>.pop(key)                         # Removes item or raises KeyError.
+{k for k, v in <dict>.items() if v == value}    # Returns set of keys that point to the value.
 {k: v for k, v in <dict>.items() if k in keys}  # Returns dictionary filtered by keys.
 

Counter

>>> from collections import Counter