python中如何判断变量类型
>>> a = 8
>>> type(a)
<class 'int'> ## 整数
>>> b = "xxx"
>>> type(b)
<class 'str'> ## 字符串
>>> c = True
>>> type(c)
<class 'bool'> ## 布尔型
>>> d = ["aaa","bbb","ccc"]
>>> type(d)
<class 'list'> ## 列表
>>> e = 2.8
>>> type(e)
<class 'float'> ## 浮点
>>>
>>> a = 8
>>> isinstance(a,int)
True
>>> isinstance(a,str)
False
>>> b = '8'
>>> isinstance(b,int)
False
>>> isinstance(b,str)
True