Take the tour ×  How do I see the type of a variable whether it
is unsigned 32 bit, signed 16 bit, etc.?  How do I view it?
share|improve this question Are you saying you have a Python
integer and want to query how large a value it can represent, or
are you saying that you want to generate values of a certain
size/signedness? –  cdleary Dec 31 '08 at 22:06 add comment  8
Answers  Python doesn't have the same types as C/C++, which
appears to be your question.  Try this:  >>> i = 123 >>> type(i)
<type 'int'> >>> type(i) is int >>> i = 123456789L >>> type(i)
<type 'long'> >>> type(i) is long >>> i = 123.456 >>> type(i)
<type 'float'> >>> type(i) is float  The distinction between int
and long goes away in Python 3.0, though.  share|improve this
answer how do you print out the type as a sting? –  Sevenearths
Oct 31 '11 at 15:26 when I execute this I get >>> type(i)
Traceback (most recent call last): File "<stdin>", line 1, in
<module> TypeError: 'str' object is not callable –  math May 3
'12 at 16:13 math: you ha