python doesn't like my numbers

Andrea Griffini agriff at tin.it
Tue Aug 24 08:35:45 CEST 2004


On Sun, 22 Aug 2004 18:52:50 -0400, Leif K-Brooks
<eurleif at ecritters.biz> wrote:

>paul k wrote:
>> 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
>
>Why do they have to start with zeros in your source code?

My guess is that his program was simply using "input()"

Im rather new to python and I've to say that I found quite
surprising that the "input" function does also evaluate
(so entering "1+1" i get the number 2 and not the string
"1+1") and that I've to use "raw_input" to get what the
user typed in.

Andrea



More information about the Python-list mailing list