>>> 01
  File "<stdin>", line 1
    01
     ^
SyntaxError: invalid token

>>> 00
0
>>> -00
0
>>> 000
0

Why do zeros not give a syntax error, but other numbers with a leading
zero do give a syntax error?  An online search reveals that in Python
2 a leading 0 starts an octal number, but this was changed in Python
3.  But then why is 00...0 valid, that is, does not give a syntax
error?

TIA!
-- 
boB
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to