File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -409,6 +409,9 @@ Format
409
409
410
410
Numbers
411
411
-------
412
+ * ** Int, float and complex are the only number types.**
413
+ * ** I use ` <num> ` to mean any of the above and ` <real> ` for either int or float.**
414
+
412
415
``` python
413
416
< int > = int (< float / str / bool > ) # Or: math.floor(<float>)
414
417
< float > = float (< int / str / bool > )
@@ -452,7 +455,7 @@ shuffle(<list>)
452
455
' 0b<bin>' = bin (< int > ) # Or: '0x<hex>' = hex(<int>)
453
456
```
454
457
455
- ### Bitwise Operators
458
+ ### Bitwise
456
459
``` python
457
460
< int > = < int > & < int > # And
458
461
< int > = < int > | < int > # Or
Original file line number Diff line number Diff line change @@ -482,6 +482,10 @@ <h4 id="inttypes">Int types:</h4>
482
482
{< span class ="hljs-number "> 90</ span > :b} < span class ="hljs-comment "> # '1011010'</ span >
483
483
</ code > </ pre >
484
484
< h2 id ="numbers "> < a href ="#numbers " name ="numbers "> #</ a > Numbers</ h2 >
485
+ < ul >
486
+ < li > < strong > Int, float and complex are the only number types.</ strong > </ li >
487
+ < li > < strong > I use < code class ="python hljs "> <num></ code > to mean any of the above and < code class ="python hljs "> <real></ code > for either int or float.</ strong > </ li >
488
+ </ ul >
485
489
< pre > < code class ="python language-python hljs "> <int> = int(<float/str/bool>) < span class ="hljs-comment "> # Or: math.floor(<float>)</ span >
486
490
<float> = float(<int/str/bool>)
487
491
<complex> = complex(real=< span class ="hljs-number "> 0</ span > , imag=< span class ="hljs-number "> 0</ span > ) < span class ="hljs-comment "> # Or: <real> + <real>j</ span >
@@ -513,7 +517,7 @@ <h3 id="binhex">Bin, Hex</h3>
513
517
<int> = int(< span class ="hljs-string "> '<bin>'</ span > , < span class ="hljs-number "> 2</ span > ) < span class ="hljs-comment "> # Or: int('<hex>', 16)</ span >
514
518
< span class ="hljs-string "> '0b<bin>'</ span > = bin(<int>) < span class ="hljs-comment "> # Or: '0x<hex>' = hex(<int>)</ span >
515
519
</ code > </ pre >
516
- < h3 id ="bitwiseoperators "> Bitwise Operators </ h3 >
520
+ < h3 id ="bitwise "> Bitwise</ h3 >
517
521
< pre > < code class ="python language-python hljs "> <int> = <int> & <int> < span class ="hljs-comment "> # And</ span >
518
522
<int> = <int> | <int> < span class ="hljs-comment "> # Or</ span >
519
523
<int> = <int> ^ <int> < span class ="hljs-comment "> # Xor (0 if both bits equal)</ span >
You can’t perform that action at this time.
0 commit comments