60 Python Examples Organized for Sharing
Small Examples 1. Numbers 1. Absolute Value Absolute value or modulus of a complex number In [1]: abs(-6) Out[1]: 6 2. Base Conversion Convert decimal to binary: In [2]: bin(10) Out[2]: '0b1010' Convert decimal to octal: In [3]: oct(9) Out[3]: '0o11' Convert decimal to hexadecimal: In [4]: hex(15) Out[4]: '0xf' 3. Integer and ASCII Conversion … Read more