|
@ -504,7 +504,15 @@ shuffle(<list>) |
|
|
<pre><code class="python language-python hljs"><int> = <span class="hljs-number">0</span>b<bin> <span class="hljs-comment"># Or: 0x<hex></span> |
|
|
<pre><code class="python language-python hljs"><int> = <span class="hljs-number">0</span>b<bin> <span class="hljs-comment"># Or: 0x<hex></span> |
|
|
<int> = int(<span class="hljs-string">'0b<bin>'</span>, <span class="hljs-number">0</span>) <span class="hljs-comment"># Or: int('0x<hex>', 0)</span> |
|
|
<int> = int(<span class="hljs-string">'0b<bin>'</span>, <span class="hljs-number">0</span>) <span class="hljs-comment"># Or: int('0x<hex>', 0)</span> |
|
|
<int> = int(<span class="hljs-string">'<bin>'</span>, <span class="hljs-number">2</span>) <span class="hljs-comment"># Or: int('<hex>', 16)</span> |
|
|
<int> = int(<span class="hljs-string">'<bin>'</span>, <span class="hljs-number">2</span>) <span class="hljs-comment"># Or: int('<hex>', 16)</span> |
|
|
<span class="hljs-string">'0b<bin>'</span> = bin(<int>) <span class="hljs-comment"># Or: '0x<bin>' = hex(<int>)</span> |
|
|
|
|
|
|
|
|
<span class="hljs-string">'0b<bin>'</span> = bin(<int>) <span class="hljs-comment"># Or: '0x<hex>' = hex(<int>)</span> |
|
|
|
|
|
</code></pre> |
|
|
|
|
|
<h3 id="bitwiseoperators">Bitwise Operators</h3> |
|
|
|
|
|
<pre><code class="python language-python hljs"><int> = <int> & <int> <span class="hljs-comment"># And</span> |
|
|
|
|
|
<int> = <int> | <int> <span class="hljs-comment"># Or</span> |
|
|
|
|
|
<int> = <int> ^ <int> <span class="hljs-comment"># Xor (0 if both bits equal)</span> |
|
|
|
|
|
<int> = <int> << n_bits <span class="hljs-comment"># Shift left</span> |
|
|
|
|
|
<int> = <int> >> n_bits <span class="hljs-comment"># Shift right</span> |
|
|
|
|
|
<int> = ~<int> <span class="hljs-comment"># Compliment (flips bits)</span> |
|
|
</code></pre> |
|
|
</code></pre> |
|
|
<h2 id="combinatorics"><a href="#combinatorics" name="combinatorics">#</a>Combinatorics</h2> |
|
|
<h2 id="combinatorics"><a href="#combinatorics" name="combinatorics">#</a>Combinatorics</h2> |
|
|
<ul> |
|
|
<ul> |
|
|