Convert '165.0' to int

Ben Finney ben+python at benfinney.id.au
Sun Jul 24 10:53:10 CEST 2011


Frank Millman <frank at chagford.com> writes:

> I know I am flogging a dead horse here, but IMHO, '165', '165.',
> '165.0', and '165.00' are all valid string representations of the
> integer 165.[1]

I disagree entirely. Once you introduce a decimal point into the
representation, you're no longer representing an integer.

(They might be the same *number*, but that's not saying the same thing.)

-- 
 \        “I saw a sign: ‘Rest Area 25 Miles’. That's pretty big. Some |
  `\                      people must be really tired.” —Steven Wright |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list