Skip to content

Commit c7c1fec

Browse files
committed
Format
1 parent 55c7bec commit c7c1fec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ import re
390390

391391
Format
392392
------
393-
```python
393+
```bash
394394
<str> = f'{<el_1>}, {<el_2>}' # Curly brackets can also contain expressions.
395395
<str> = '{}, {}'.format(<el_1>, <el_2>) # Or: '{0}, {a}'.format(<el_1>, a=<el_2>)
396396
<str> = '%s, %s' % (<el_1>, <el_2>) # Redundant and inferior C-style formatting.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@
364364
<li><strong>As shown above, it restricts all special sequence matches to the first 128 characters and prevents <code class="python hljs"><span class="hljs-string">'\s'</span></code> from accepting <code class="python hljs"><span class="hljs-string">'[\x1c-\x1f]'</span></code> (the so-called separator characters).</strong></li>
365365
<li><strong>Use a capital letter for negation (all non-ASCII characters will be matched when used in combination with ASCII flag).</strong></li>
366366
</ul>
367-
<div><h2 id="format"><a href="#format" name="format">#</a>Format</h2><pre><code class="python language-python hljs">&lt;str&gt; = <span class="hljs-string">f'<span class="hljs-subst">{&lt;el_1&gt;}</span>, <span class="hljs-subst">{&lt;el_2&gt;}</span>'</span> <span class="hljs-comment"># Curly brackets can also contain expressions.</span>
367+
<div><h2 id="format"><a href="#format" name="format">#</a>Format</h2><pre><code class="bash language-bash hljs">&lt;str&gt; = f<span class="hljs-string">'{&lt;el_1&gt;}, {&lt;el_2&gt;}'</span> <span class="hljs-comment"># Curly brackets can also contain expressions.</span>
368368
&lt;str&gt; = <span class="hljs-string">'{}, {}'</span>.format(&lt;el_1&gt;, &lt;el_2&gt;) <span class="hljs-comment"># Or: '{0}, {a}'.format(&lt;el_1&gt;, a=&lt;el_2&gt;)</span>
369369
&lt;str&gt; = <span class="hljs-string">'%s, %s'</span> % (&lt;el_1&gt;, &lt;el_2&gt;) <span class="hljs-comment"># Redundant and inferior C-style formatting.</span>
370370
</code></pre></div>

0 commit comments

Comments
 (0)