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