TypeError: ‘int’ object is not callable ‘; ‘int’ object cannot be called .
I just want to use the sum of the 1-100, and () function, but an error, because I’m using ipython, I at first thought it was the cause of the ipython, then I will bring in python interactive tool test, found that there is no problem, can be normal use, the following figure:
I then looked at me in ipython before operation, before the strong> “sum” this keyword is defined as a variable name, then I tried to put their own custom variables to deleted, please try again after deleting, found, it was the sum () function is when the cause of the variable name before, It’s attempt to:
lookup is defined before the variable name strong>
by reset delete custom variable strong>
try again, can be normal use strong>
this is my problem and the solution, the hope can help you!
hint: python variable names and method names should not be the same