python doesn't like my numbers
Alan Kennedy
alanmk at hotmail.com
Sun Aug 22 18:04:15 EDT 2004
[paul k]
> is there any way to convince python not to take my (phone)numbers
> starting with zero as octals?
>
> >>> int(088)
> File "<stdin>", line 1
> int(088)
> ^
> SyntaxError: invalid token
Answer 1: Use strings: that's really what telephone numbers should be
Answer 2: Use valid octal digits in your phone numbers. The digit '8'
cannot appear in base 8 numbers, only the digits 0-7.
>>> int(077)
63
>>> int(088)
Traceback (innermost last):
(no code object) at line 0
File "<console>", line 1
int(088)
^
SyntaxError: invalid syntax
>>>
--
alan kennedy
------------------------------------------------------
email alan: http://xhaus.com/contact/alan
More information about the Python-list
mailing list