Why does int(5.0) returns 0

Irmen de Jong irmen at NOSPAM-REMOVETHIS-xs4all.nl
Sun Jan 26 19:25:43 EST 2003


Samir Patel wrote:
> Here is verbose output of program: print int(5.0)
> 
> It outputs 0

No, it doesn't.

Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print int(5.0)
5

You must have made some kind of typo?
Otherwise your Python installation is seriously broken.

Irmen





More information about the Python-list mailing list