Sunday, November 6, 2011

Python: Get variable type

Use type() function:

>>> d=['one','two']
>>> print d
['one', 'two']
>>> type(d)
<type 'list'>

Source:
http://linux.byexamples.com/archives/342/python-how-to-identify-the-type-of-your-variable/

No comments: