你可能在找
type()
功能。
请参阅下面的示例,但是在Python中没有像Java那样的“unsigned”类型。
正整数:
>>> v = 10
>>> type(v)
<type 'int'>
大的
正整数:
>>> v = 100000000000000
>>> type(v)
<type 'long'>
负整数:
>>> v = -10
>>> type(v)
<type 'int'>
文字字符序列:
>>> v = 'hi'
>>> type(v)
<type 'str'>
浮点整数:
>>> v = 3.14159
>>> type(v)
<type 'float'>