diff --git a/README.md b/README.md index 4c571e5..009a83d 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ value = .setdefault(key, default=None) # Returns and writes default if .update() # Adds items. Replaces ones with matching keys. value = .pop(key) # Removes item or raises KeyError if missing. {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 a dictionary, filtered by keys. +{k: v for k, v in .items() if k in keys} # Filters the dictionary by keys. ``` ### Counter diff --git a/index.html b/index.html index c0eaea6..31122ca 100644 --- a/index.html +++ b/index.html @@ -147,7 +147,7 @@ value = <dict>.setdefault(key, default=None<dict>.update(<dict>) # Adds items. Replaces ones with matching keys. value = <dict>.pop(key) # Removes item or raises KeyError if missing. {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 a dictionary, filtered by keys. +{k: v for k, v in <dict>.items() if k in keys} # Filters the dictionary by keys.

Counter

>>> from collections import Counter
 >>> colors = ['blue', 'blue', 'blue', 'red', 'red']