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

 

相关文章:

  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2021-08-20
  • 2021-11-04
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
相关资源
相似解决方案