Why isn't it possible to directly convert a floating point number represented as a string in Python to an int variable?
For example,
>>> val=str(10.20)
>>> int(val)
Traceback (most recent call last):
File "<stdin>", line 1, in
ValueError: invalid literal for int() with base 10: '10.2'
However, this works,
>>> int(float(val))
10
import this). Explicitly converting an integer to a float is very different to quietly dropping parts of a string without warning the user that it wasn't what they expected.