擅长:python、mysql、java
<p>实际上,<a href="https://docs.python.org/2/library/functions.html#type" rel="noreferrer">^{<cd1>}</a>函数接受一个对象并返回它的类型。请尝试以下代码:</p>
<pre><code>for item in [1,2,3, 'string', None]:
print type(item)
</code></pre>
<p>输出:</p>
<pre><code><type 'int'>
<type 'int'>
<type 'int'>
<type 'str'>
<type 'NoneType'>
</code></pre>