Why does a number like 01 give a syntax error when 01 is entered in python interactive mode and enter is pressed?
When you enter 00 interpreter evaluates to 0 , but numbers are entered, such as 01 , 001 or anything starting with 0 . Syntax error: invalid token displayed.
Entering 1,000 at the prompt evaluates the tuple (1,0) , but 1,001 does not evaluate the value (1,1) , but a syntax error appears.
Why does the Python interpreter behave like this?
source share