python 数值类型,判断类型

整型

布尔类型

浮点型

e(科学计算法)



type 函数                                           isinstance

判读一个数的类型                         判读一个数的类型    

数字类型  返回一个布尔值

>>> type(520)                               >>> a = 'abc'

>>> isinstance(a,str)
True

 

字符串类型

>>> type('abc') >>> isinstance(a,int)
False


布尔类型

>>> type(True)





你可能感兴趣的:(python)