Why Python don't accept 03 as a number?

Paulo da Silva p_s_d_a_s_i_l_v_a_ns at netcabo.pt
Fri Dec 7 20:42:41 EST 2018


Às 01:17 de 08/12/18, jfong at ms4.hinet.net escreveu:
>>>> 00
> 0
>>>> 03
>   File "<stdin>", line 1
>     03
>      ^
> SyntaxError: invalid token
>>>>
> 
> Any particular reason?
> 

Not sure but I think that after 0 it expects x for hexadecimal, o for
octal, b for binary, ... may be others.

0xa
10

0o10
8

0b10
2


More information about the Python-list mailing list