zipcode = 02132
print zipcode
result = 1114
A leading zero means octal. 2132 in octal equals 1114 in decimal. They removed this behavior in Python 3.0.
In Python 2.x, number with a leading zero is interpreted as octal (base-eight). Python 3.x requires a leading "0o" to indicate an octal number. You probably want to treat a zipcode as a string to keep the leading zeroes intact.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With