Steven D'Aprano wrote:
> On Wed, 21 Dec 2005 03:37:27 -0800, Neuruss wrote:
>>>>>x = '15'
>>>>>if x.isdigit():
>>
>>      print int(x)*3
> 
> 
> 15 is not a digit. 1 is a digit. 5 is a digit. Putting them together to
> make 15 is not a digit.

Maybe so, but '15'.isdigit() == True:

isdigit(...)
     S.isdigit() -> bool

     Return True if all characters in S are digits
     and there is at least one character in S, False otherwise.

  >>> '15'.isdigit()
True

though your other points are valid and I agree this is not the right solution 
to the OP.

Kent

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to