Python doesn't have the same types as C/C++, which appears to be your question.
(Python没有与C / C ++相同的类型,这似乎是你的问题。)
Try this:
(试试这个:)
>>> i = 123
>>> type(i)
<type 'int'>
>>> type(i) is int
True
>>> i = 123456789L
>>> type(i)
<type 'long'>
>>> type(i) is long
True
>>> i = 123.456
>>> type(i)
<type 'float'>
>>> type(i) is float
True
The distinction between int and long goes away in Python 3.0, though.
(但是,在Python 3.0中,int和long之间的区别消失了。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…