V
Vineet Jain
int('2.1') does not work while int(float('2.1')) does. If int can covert a
float object then there is no reason why a float string should not be
converted too.
When I do int('2.1') I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 2.0
This does not seem very pythonic
VJ
float object then there is no reason why a float string should not be
converted too.
When I do int('2.1') I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 2.0
This does not seem very pythonic
VJ