I’ve just noticed 0-padding is not allowed in Python and I was wondering why this choice was made?
For example:
a = 09
doesn’t work while
a = 9
does
How’s that?!
Thank you very much for your answers!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python, as many other languages, treat numbers starting with 0 as being in octal notation. 09 is not valid as octal
See chapter 2.4.4 in the python language reference.