Browse Source

Bin and hex functions

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

5
README.md

@ -286,6 +286,11 @@ String
<list> = textwrap.wrap(<str>, width) # Nicely breaks string into lines. <list> = textwrap.wrap(<str>, width) # Nicely breaks string into lines.
``` ```
```python
<str> = bin(<int>) # Binary representation starting with '0b'.
<str> = hex(<int>) # Hexadecimal representation starting with '0x'.
```
### Char ### Char
```python ```python
<str> = chr(<int>) # Converts int to unicode char. <str> = chr(<int>) # Converts int to unicode char.

3
index.html

@ -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">&lt;bool&gt; = &lt;str&gt;.isnumeric() <span class="hljs-comment"># True if str contains only numeric characters.</span> <pre><code class="python language-python hljs">&lt;bool&gt; = &lt;str&gt;.isnumeric() <span class="hljs-comment"># True if str contains only numeric characters.</span>
&lt;list&gt; = textwrap.wrap(&lt;str&gt;, width) <span class="hljs-comment"># Nicely breaks string into lines.</span> &lt;list&gt; = textwrap.wrap(&lt;str&gt;, width) <span class="hljs-comment"># Nicely breaks string into lines.</span>
</code></pre> </code></pre>
<pre><code class="python language-python hljs">&lt;str&gt; = bin(&lt;int&gt;) <span class="hljs-comment"># Binary representation starting with '0b'.</span>
&lt;str&gt; = hex(&lt;int&gt;) <span class="hljs-comment"># Hexadecimal representation starting with '0x'.</span>
</code></pre>
<h3 id="char">Char</h3> <h3 id="char">Char</h3>
<pre><code class="python language-python hljs">&lt;str&gt; = chr(&lt;int&gt;) <span class="hljs-comment"># Converts int to unicode char.</span> <pre><code class="python language-python hljs">&lt;str&gt; = chr(&lt;int&gt;) <span class="hljs-comment"># Converts int to unicode char.</span>
&lt;int&gt; = ord(&lt;str&gt;) <span class="hljs-comment"># Converts unicode char to int.</span> &lt;int&gt; = ord(&lt;str&gt;) <span class="hljs-comment"># Converts unicode char to int.</span>

Loading…
Cancel
Save