In Python 2, integers were allowed leading zeros:

>>> 001
1

This changed in Python 3:

>>> 001
  File "<stdin>", line 1
    001
      ^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

The one exception is 0, which is still allowed leading zeros in either version of Python:

>>> 000
0

I scoured the internet for an explanation but came up empty-handed. My best guess is that the 0o and 00 characters are too visually similar and easy to accidentally confuse. Just compare the similarity of 0o040 (32 as a decimal number) and 00040 (40 as a decimal number). I wonder how many times someone had to debug that before they decided to change it...

So why does 000 still work in Python 3? Because 0o0 and 000 both evaluate to zero, of course!