|
|
@ -389,6 +389,9 @@ Point(x=<span class="hljs-number">1</span>, y=<span class="hljs-number">2</span> |
|
|
|
<pre><code class="python language-python hljs"><bool> = <str>.isnumeric() <span class="hljs-comment"># True if str contains only numeric characters.</span> |
|
|
|
<list> = textwrap.wrap(<str>, width) <span class="hljs-comment"># Nicely breaks string into lines.</span> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><str> = bin(<int>) <span class="hljs-comment"># Binary representation starting with '0b'.</span> |
|
|
|
<str> = hex(<int>) <span class="hljs-comment"># Hexadecimal representation starting with '0x'.</span> |
|
|
|
</code></pre> |
|
|
|
<h3 id="char">Char</h3> |
|
|
|
<pre><code class="python language-python hljs"><str> = chr(<int>) <span class="hljs-comment"># Converts int to unicode char.</span> |
|
|
|
<int> = ord(<str>) <span class="hljs-comment"># Converts unicode char to int.</span> |
|
|
|