python - Check if string is a real number -


is there quick way find if string real number, short of reading character @ time , doing isdigit() on each character? want able test floating point numbers, example 0.03001.

if mean float real number should work:

def isfloat(str):     try:          float(str)     except valueerror:          return false     return true 

note internally still loop string, inevitable.


Comments

Popular posts from this blog

c++ - error: use of deleted function -

delphi - ESC/P programming! -

c# - how to write client side events functions for the combobox items -