Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The error message "Float object is not callable" means that you have tried to call an instance of a float object as if it were a function. In other words, you have used parentheses after a float value as if it were a function that could be called. This is not allowed in Python.

In the code you provided, the error may occur if you try to call the "stock" variable as a function, like this:

stock=float(input("enter the stock"))
stock()

In this example, the second line is attempting to call the "stock" variable as a function, which is not allowed and will produce the "Float object is not callable" error.

To fix this error, make sure you are not trying to call a float variable as a function. Check that you are using parentheses correctly and are not accidentally trying to call a variable as a function.