Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check for the negative integers and float

def is_number(n):
    try:
        float(n)   # Type-casting the string to `float`.
                   # If string is not a valid `float`, 
                   # it'll raise `ValueError` exception
    except ValueError:
        return False
    return True
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #negative #integers #float
ADD COMMENT
Topic
Name
4+2 =