The number 0
is a prefix on an integer literal indicating that it is an octal number in python.
...which as I accidentally omitted, and as @larsmans so kindly pointed out in his comment, limits the number to containing only the numerals 0
through 7
, excluding 8
and 9
.
Though, also of note, this is the syntax in Python 2.x - it was changed as of Python 3.0, ostensibly for the exact reason that you came here. PEP 3127 contains the details of the change.
The most relevant bit:
Almost all currently popular computer languages, including C/C++, Java, Perl, and JavaScript, treat a sequence of digits with a leading zero as an octal number. Proponents of treating these numbers as decimal instead have a very valid point -- [...] the entire non-computer world uses decimal numbers almost exclusively.