So if this "%05d" % 123 returns #=> "00123", I would expect "%05d" % 0123 to return #=> "00123" as well, but instead it returns #=> "00083". Why is this so?
So if this %05d % 123 returns #=> 00123 , I would expect %05d
Share
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.
Numbers starting with 0 are interpreted as octal, just like numbers starting with 0x are interpreted as hexadecimal. 83 is represented as 123 in octal.