This error is caused because we try to convert “7.4: to an integer. The value “7.4” is formatted as a string. Python cannot convert a floating-point number in a string to an integer.
To overcome this issue, we need to convert the value a user inserts to a floating-point number. Then, we can convert it to an integer.
We can do this by using the float() and int() statements. The int() function returns an integer. The float() function returns a floating-point representation of a float.