Why gives "k = 09" a syntax error ?

Stef Mientki stef.mientki at gmail.com
Wed Oct 29 15:44:36 EDT 2008


Guilherme Polo wrote:
> On 10/29/08, Stef Mientki <stef.mientki at gmail.com> wrote:
>   
>> hello,
>>
>>  Why gives "k = 09"  a syntax error ?
>>
>>     
>
> 09 is not a valid octal number. Instead use 011.
>
> Ok, I guess you were not aware that prefixing a number with a '0'
> would cause python to parse it as an octal and now you know.
>   
thanks guys,
I didn't realize there were still people using octal notation ;-)

cheers,
Stef



More information about the Python-list mailing list