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

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

zipcode = 02132

print zipcode

result = 1114

6条回答
  •  北海茫月
    2020-12-07 02:52

    A leading zero means octal. 2132 in octal equals 1114 in decimal. They removed this behavior in Python 3.0.

提交回复
热议问题