A question about string and float number

Wei Guo weiguo6 at gmail.com
Wed Aug 6 21:23:15 EDT 2008


Hi all,

I am new of python. Could anyone help me a question as below?

Is there any function that can judge a string s is a float number or not?
FOr example, if s = '1.232' or s='1e+10', then it returns true, otherwise,
it will return false.

isdigit() in string doesn't work. float() will throw an exception and I just
need true or false as result.

Thanks a lot in advance,

Wei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080806/6ce67789/attachment.html>


More information about the Python-list mailing list