Oct-11-2017, 09:41 AM
Very simple chunk of code:
ValueError: invalid literal for int() with base 10: '2.3'
If int() accepts a string or a float, why does it not handle this value by truncating?
ip = input("Enter #:") ip = int(ip)If I enter 2.3, why do I get:
ValueError: invalid literal for int() with base 10: '2.3'
If int() accepts a string or a float, why does it not handle this value by truncating?