I have one method which takes many argument and also return multiple value
I am trying to open a file in that method but it shows me error like
fc=open("ABC.txt","a")
Type Error: 'float' object is not callable`
I don't know why it is showing this error i mean there is nothing like a float value. The same line if I put in the calling function then it will create/open file successfully.
fc=open("ABC.txt","a")
The issue might be that somewhere else in your code, you have defined a variable called
open
which is storing afloat
type value. Example -The above line actually overwrites the inbuilt function
open
with the float variable, hence after this line any call toopen
would be referencing the float variable, causing the issue. You should not use built-in names for variables, try renaming the variable.