0
Mafalda posted
Python - ValueError: invalid literal for int() with base 10
i try to run some code in Python but when i run below code:
interger =input('enter no:')
print(int(interger))
it giving the error as below when i enter '2.2':
File "<stdin>", line 13, in <module>
ValueError: invalid literal for int() with base 10: '2.2'
i want to convert string or float value to integer
how to solve ValueError in Python ?