Octal number problem
revanna at mn.rr.com
Thu Feb 20 03:50:57 CET 2003
On Thu, 20 Feb 2003 02:27:37 +0000, Raymond Hettinger wrote:
> [Gary Duncan]
>> Python has the quaint behaviour of interpreting a numeric string with a
>> leading zero as octal, a bit like C.
>> How does one disable this behaviour, ie get it to treat such strings as
>> a "normal" decimal number ?
> The int() function will assume base 10 and ignore the leading zero cue for
Be careful of your quotes, however. Without the quotes, you'll get:
which is probably not what you want.
More information about the Python-list