Browse Source

Dict

pull/45/head
Jure Šorn 5 years ago
parent
commit
8e006496e4
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -79,7 +79,7 @@ value = <dict>.setdefault(key, default=None) # Same, but also adds default to
```
```python
<dict>.update(<dict>) # Or: dict_a = {**dict_a, **dict_b}.
<dict>.update(<dict>)
<dict> = dict(<collection>) # Creates a dict from coll. of key-value pairs.
<dict> = dict(zip(keys, values)) # Creates a dict from two collections.
<dict> = dict.fromkeys(keys [, value]) # Creates a dict from collection of keys.

2
index.html

@ -251,7 +251,7 @@ value = &lt;dict&gt;.setdefault(key, default=<span class="hljs-keyword">None</s
&lt;dict&gt; = collections.defaultdict(&lt;type&gt;) <span class="hljs-comment"># Creates a dict with default value of type.</span>
&lt;dict&gt; = collections.defaultdict(<span class="hljs-keyword">lambda</span>: <span class="hljs-number">1</span>) <span class="hljs-comment"># Creates a dict with default value 1.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;dict&gt;.update(&lt;dict&gt;) <span class="hljs-comment"># Or: dict_a = {**dict_a, **dict_b}.</span>
<pre><code class="python language-python hljs">&lt;dict&gt;.update(&lt;dict&gt;)
&lt;dict&gt; = dict(&lt;collection&gt;) <span class="hljs-comment"># Creates a dict from coll. of key-value pairs.</span>
&lt;dict&gt; = dict(zip(keys, values)) <span class="hljs-comment"># Creates a dict from two collections.</span>
&lt;dict&gt; = dict.fromkeys(keys [, value]) <span class="hljs-comment"># Creates a dict from collection of keys.</span>

Loading…
Cancel
Save