On Mon, Oct 17, 2011 at 2:44 PM, Noah Hall <enali...@gmail.com> wrote:
> There's the isdigit method, for example -
>
>>>> str = "1324325"
>>>> str.isdigit()
> True
>>>> str = "1232.34"
>>>> str.isdigit()
> False
>>>> str = "I am a string, not an int!"
>>>> str.isdigit()
> False

That works for non-negative base-10 integers.  But:

>>> "-1234".isdigit()
False

Cheers,
Ian
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to