Roland's homepage

My random knot in the Web

Articles about programming

  1. Python number conversions

    Sometimes one has to convert numbers from and to different formats. Below are some examples in Python 3 that I picked up over time. What you see are excerpts of IPython sessions.

    To and from hexadecimal (base 16):

    In [1]: hex(100)
    Out[1]: '0x64'
    
    In [2]: int(0xa7)
    Out …

←  Page 1 Page 2 / 2