[Tutor] (no subject)

Alan Gauld alan.gauld at freenet.co.uk
Tue Feb 8 11:28:30 CET 2005


Subject: Re: [Tutor] Hex to Str - still an open issue
Date: Tue, 8 Feb 2005 10:29:07 -0000
MIME-Version: 1.0
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441

> >>> binary(2)
> '00000000000000000000000000000010'
> >>> int(00000000000000000000000000000010)
> 8

In Python (and most C based languages) a number starting 
with 0 is assumed to be in octal.

so 010 in octal is 8 in decimal.

Alan g. 



More information about the Tutor mailing list