<dict>.update(<dict>)<spanclass="hljs-comment"># Adds items. Replaces ones with matching keys.</span>
[k <spanclass="hljs-keyword">for</span> k, v <spanclass="hljs-keyword">in</span><dict>.items() <spanclass="hljs-keyword">if</span> v == value]<spanclass="hljs-comment"># Returns list of keys that point to the value.</span>
<pre><codeclass="python language-python hljs"><dict>.update(<dict>)<spanclass="hljs-comment"># Adds items. Replaces ones with matching keys.</span>
value = <dict>.pop(key) <spanclass="hljs-comment"># Removes item or raises KeyError.</span>
{k <spanclass="hljs-keyword">for</span> k, v <spanclass="hljs-keyword">in</span><dict>.items() <spanclass="hljs-keyword">if</span> v == value}<spanclass="hljs-comment"># Returns set of keys that point to the value.</span>
{k: v <spanclass="hljs-keyword">for</span> k, v <spanclass="hljs-keyword">in</span><dict>.items() <spanclass="hljs-keyword">if</span> k <spanclass="hljs-keyword">in</span> keys} <spanclass="hljs-comment"># Returns dictionary filtered by keys.</span>