Python中出現ValueError: could not convert string to float:應該怎么處理
import sys import math # 判斷是否為浮點數 def isNum2(value): try: x = float(value) #此處更改想判斷的類型 except TypeError: return False except ValueError: return False except Exception as e: return False else: return True
感謝來源
https://blog.csdn.net/u010299224/article/details/50787427