Why Python don't accept 03 as a number?

Antoon Pardon antoon.pardon at vub.be
Mon Dec 10 05:07:11 EST 2018


On 8/12/18 07:59, Serhiy Storchaka wrote:
> 08.12.18 03:17, jfong at ms4.hinet.net пише:
>>>>> 00
>> 0
>>>>> 03
>>    File "<stdin>", line 1
>>      03
>>       ^
>> SyntaxError: invalid token
>
>
> In Python 3.8 the error message will be more informative:
>
>>>> 03
>   File "<stdin>", line 1
> SyntaxError: leading zeros in decimal integer literals are not
> permitted; use an 0o prefix for octal integers
>
That is not helpful if it makes the code more meaningful to write 073
and I want it to have the value 73 not 0o73. -- Antoon.




More information about the Python-list mailing list