Skip to content

Commit b785fc1

Browse files
committed
Numbers, array
1 parent 7f36307 commit b785fc1

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,15 @@ Format
405405

406406
Numbers
407407
-------
408+
```python
409+
<int> = int(<float/str/bool>) # Or: math.floor(<float>)
410+
<float> = float(<int/str/bool>)
411+
<complex> = complex(real=0, imag=0) # Or: <real> + <real>j
412+
```
413+
408414
### Basic Functions
409415
```python
410-
<num> = pow(<num>, <num>) # Or: <num> ** <num>
416+
<num> = pow(<num>, <num>) # Or: <num> ** <num>
411417
<real> = abs(<num>)
412418
<int> = round(<real>)
413419
<real> = round(<real>, ±ndigits)
@@ -1468,7 +1474,7 @@ b'\x00\x01\x00\x02\x00\x00\x00\x03'
14681474

14691475
Array
14701476
-----
1471-
**List that can hold only elements of predefined type. Available types are listed above.**
1477+
**List that can hold only elements of predefined type. Available types and their sizes are listed above.**
14721478

14731479
```python
14741480
from array import array

index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,12 @@ <h4 id="inttypes">Int types:</h4>
475475
{<span class="hljs-number">90</span>:b} <span class="hljs-comment"># '1011010'</span>
476476
</code></pre>
477477
<h2 id="numbers"><a href="#numbers" name="numbers">#</a>Numbers</h2>
478+
<pre><code class="python language-python hljs">&lt;int&gt; = int(&lt;float/str/bool&gt;) <span class="hljs-comment"># Or: math.floor(&lt;float&gt;)</span>
479+
&lt;float&gt; = float(&lt;int/str/bool&gt;)
480+
&lt;complex&gt; = complex(real=<span class="hljs-number">0</span>, imag=<span class="hljs-number">0</span>) <span class="hljs-comment"># Or: &lt;real&gt; + &lt;real&gt;j</span>
481+
</code></pre>
478482
<h3 id="basicfunctions">Basic Functions</h3>
479-
<pre><code class="python language-python hljs">&lt;num&gt; = pow(&lt;num&gt;, &lt;num&gt;) <span class="hljs-comment"># Or: &lt;num&gt; ** &lt;num&gt;</span>
483+
<pre><code class="python language-python hljs">&lt;num&gt; = pow(&lt;num&gt;, &lt;num&gt;) <span class="hljs-comment"># Or: &lt;num&gt; ** &lt;num&gt;</span>
480484
&lt;real&gt; = abs(&lt;num&gt;)
481485
&lt;int&gt; = round(&lt;real&gt;)
482486
&lt;real&gt; = round(&lt;real&gt;, ±ndigits)
@@ -1281,7 +1285,7 @@ <h4 id="usecapitalletterforunsignedtypestandardsizesareinbrackets">Use capital l
12811285
<li><strong><code class="python hljs"><span class="hljs-string">'d'</span></code> - double (8)</strong></li>
12821286
</ul>
12831287
<h2 id="array"><a href="#array" name="array">#</a>Array</h2>
1284-
<p><strong>List that can hold only elements of predefined type. Available types are listed above.</strong></p>
1288+
<p><strong>List that can hold only elements of predefined type. Available types and their sizes are listed above.</strong></p>
12851289
<pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> array <span class="hljs-keyword">import</span> array
12861290
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span> [, &lt;collection&gt;])
12871291
</code></pre>

0 commit comments

Comments
 (0)