Python与
C / C ++的类型不同,这似乎是你的问题。
尝试这个:
>>> i = 123>>> type(i)<type 'int'>>>> type(i) is intTrue>>> i = 123456789L>>> type(i)<type 'long'>>>> type(i) is longTrue>>> i = 123.456>>> type(i)<type 'float'>>>> type(i) is floatTrue
不过,在Python 3.0中int和long之间的区别消失了。



