You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -261,8 +261,8 @@
261
261
<view> = <dict>.items() <spanclass="hljs-comment"># Coll. of key-value tuples.</span>
262
262
</code></pre></div>
263
263
264
-
<pre><codeclass="python language-python hljs">value = <dict>.get(key, default=<spanclass="hljs-keyword">None</span>) <spanclass="hljs-comment"># Returns default if key does not exist.</span>
265
-
value = <dict>.setdefault(key, default=<spanclass="hljs-keyword">None</span>) <spanclass="hljs-comment"># Adds default to dict if key doesn't exist.</span>
264
+
<pre><codeclass="python language-python hljs">value = <dict>.get(key, default=<spanclass="hljs-keyword">None</span>) <spanclass="hljs-comment"># Returns default if key is missing.</span>
265
+
value = <dict>.setdefault(key, default=<spanclass="hljs-keyword">None</span>) <spanclass="hljs-comment"># Returns and writes default if key is missing.</span>
266
266
<dict> = collections.defaultdict(<type>) <spanclass="hljs-comment"># Creates a dict with default value of type.</span>
267
267
<dict> = collections.defaultdict(<spanclass="hljs-keyword">lambda</span>: <spanclass="hljs-number">1</span>) <spanclass="hljs-comment"># Creates a dict with default value 1.</span>
0 commit comments