Converting FROM decimal

Matthew Dixon Cowles matt at mondoinfo.com
Sun Sep 24 22:34:41 EDT 2000


On 25 Sep 2000 02:26:37 GMT, insyte at petra.squad51.net
<insyte at petra.squad51.net> wrote:
>I've found several references here and there (FAQTS, etc.) about
>converting from hex, octal, etc. to decimal, but nothing about going
>the other way.  I suppose I could write my own function, but I can't
>believe there isn't something already in the Python repertoire to do
>this.

There are builtins to do those conversions:

>>> hex(10)
'0xa'
>>> oct(10)
'012'

Regards,
Matt



More information about the Python-list mailing list