python如何打印变量的类型

对于基本类型使用type函数,即python print type(a)  对于对象,使用__class__,或者直接str()函数 print a.__class__ print str(a)   参考:http://outofmemory.cn/code-snippet/13637/python-get-type-of-variable-or-instancecode
相关文章
相关标签/搜索