python test if a str is a float code example Example: check if a string is float python try: float(element) except ValueError: print "Not a float"