int('0.0') throws an exception

Skip Montanaro skip at pobox.com
Wed Jan 29 19:20:41 EST 2003


    Ragu> int('0') and int(0.0) are OK but int('0.0') throws an Exception?

Because '0.0' is not a string representing an int.  It's a string
representing a float.

S





More information about the Python-list mailing list