Convert '165.0' to int

Frank Millman frank at chagford.com
Sun Jul 24 05:01:32 EDT 2011


On Jul 24, 10:53 am, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> Frank Millman <fr... 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.)
>

Fair enough. I never did CS101, so I am looking at this from a
layman's perspective. I am happy to be corrected.

Frank



More information about the Python-list mailing list