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
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -262,7 +262,7 @@
262
262
</code></pre></div>
263
263
264
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"># Same, but also adds default to dict.</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>
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