Not getting exact result in python with the values leading zero. Please tell me what is going on there

前端 未结 6 627
温柔的废话
温柔的废话 2020-12-07 02:28

zipcode = 02132

print zipcode

result = 1114

6条回答
  •  失恋的感觉
    2020-12-07 02:56

    What is your question? I guess, why is that. The answer is octal numbers. If a number starts with a zero, Python thinks you mean an octal number. (Base 8)

提交回复
热议问题