[Tutor] calling subroutines into program

Jacob S. keridee at jayco.net
Wed Feb 9 03:17:21 CET 2005


> Liam Clarke wrote:
>> oh? Is is the negative?
> 
> No, the decimal fraction. It's easy enough to try it:

Not exactly, it's a combination of string *and* decimal fraction.
>>> int('-945')
-945
>>> int('-945.0')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): -945.0
>>> int(-945.0)
-945
>>>

Jacob

>  >>> int('950')
> 950
>  >>> int('-950')
> -950
>  >>> int('950.00')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ValueError: invalid literal for int(): 950.00
>  >>> int('-950.00')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ValueError: invalid literal for int(): -950.00
> 
> Kent
> 



More information about the Tutor mailing list