[Tutor] Re: Question on Regular Expression Help

Don Arnold Don Arnold" <darnold02@sprynet.com
Sat Feb 8 12:06:34 2003


<snip>

> 
> Don Arnold wrote:
> > >>> def isInt(aString):
> >  try:
> >   int(aString)
> >   return True
> >  except:
> >   return False
> 
> But note that int(3.14) => 3 ! Is that what you want? Is 3.14 an integer?
> 

Nope: int(3.14) => 3, but int('3.14') raises an exception as intended.

Don