Skip to content

Commit 06f54c7

Browse files
committed
List and regex
1 parent 66952c2 commit 06f54c7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ index = <list>.index(<el>) # Returns first index of item.
5959
<list>.insert(index, <el>) # Inserts item at index and moves the rest to the right.
6060
<el> = <list>.pop([index]) # Removes and returns item at index or from the end.
6161
<list>.remove(<el>) # Removes first occurrence of item or raises ValueError.
62-
<list>.clear() # Removes all items.
62+
<list>.clear() # Removes all items. Also works on dict and set.
6363
```
6464

6565

@@ -324,6 +324,9 @@ import re
324324
<str> = <Match>.group() # Whole match.
325325
<str> = <Match>.group(1) # Part in first bracket.
326326
<tuple> = <Match>.groups() # All bracketed parts.
327+
```
328+
329+
```python
327330
<int> = <Match>.start() # Start index of a match.
328331
<int> = <Match>.end() # Exclusive end index of a match.
329332
```

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ <h2 id="list"><a href="#list" name="list">#</a>List</h2>
241241
&lt;list&gt;.insert(index, &lt;el&gt;) <span class="hljs-comment"># Inserts item at index and moves the rest to the right.</span>
242242
&lt;el&gt; = &lt;list&gt;.pop([index]) <span class="hljs-comment"># Removes and returns item at index or from the end.</span>
243243
&lt;list&gt;.remove(&lt;el&gt;) <span class="hljs-comment"># Removes first occurrence of item or raises ValueError.</span>
244-
&lt;list&gt;.clear() <span class="hljs-comment"># Removes all items.</span>
244+
&lt;list&gt;.clear() <span class="hljs-comment"># Removes all items. Also works on dict and set.</span>
245245
</code></pre>
246246
<h2 id="dictionary"><a href="#dictionary" name="dictionary">#</a>Dictionary</h2>
247247
<pre><code class="python language-python hljs">&lt;view&gt; = &lt;dict&gt;.keys() <span class="hljs-comment"># Coll. of keys that reflects changes.</span>
@@ -419,7 +419,8 @@ <h3 id="matchobject">Match Object</h3>
419419
<pre><code class="python language-python hljs">&lt;str&gt; = &lt;Match&gt;.group() <span class="hljs-comment"># Whole match.</span>
420420
&lt;str&gt; = &lt;Match&gt;.group(<span class="hljs-number">1</span>) <span class="hljs-comment"># Part in first bracket.</span>
421421
&lt;tuple&gt; = &lt;Match&gt;.groups() <span class="hljs-comment"># All bracketed parts.</span>
422-
&lt;int&gt; = &lt;Match&gt;.start() <span class="hljs-comment"># Start index of a match.</span>
422+
</code></pre>
423+
<pre><code class="python language-python hljs">&lt;int&gt; = &lt;Match&gt;.start() <span class="hljs-comment"># Start index of a match.</span>
423424
&lt;int&gt; = &lt;Match&gt;.end() <span class="hljs-comment"># Exclusive end index of a match.</span>
424425
</code></pre>
425426
<h3 id="specialsequences">Special Sequences</h3>

0 commit comments

Comments
 (0)