【python】判断数据 属性 类型

>>> print(type(output))
<class 'str'>
>>> print(type(line))
<class 'list'>
>>> f = {}
>>> print(type(f))
<class 'dict'>
>>> g = []
>>> print(type(g))
<class 'list'>
>>> h = ()
>>> print(type(h))
<class 'tuple'>
>>> j = ''
>>> print(type(j))
<class 'str'>
>>> k = 0
>>> print(type(k))
<class 'int'>
>>> l = 0.999
>>> print(type(l))
<class 'float'>
>>>
阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页