可以使用Python 内置函数isinstance() 来判断一个变量是否为浮点类型。 示例: import math x = 1.23 if isinstance(x, float): print("x is a ...
確定! 回上一頁