binary literal

Hendrik van Rooyen hendrik at microcorp.co.za
Thu Jul 23 03:25:22 EDT 2009


On Wednesday 22 July 2009 12:03:44 superpollo wrote:

> can i do something like the above, but using a *binary* number? (e.g.
> 00101101 instead of 45) ?

00101101 is not hex 45.
hex 45 is 01000101

>>> chr(int('01000101',2))
'E'
>>>

- Hendrik






More information about the Python-list mailing list