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
Read More:
- python Use timeit Error: stmt is neither a string nor callable
- [How to Solve] Python TypeError: ‘int‘ object is not subscriptable
- Python PIP TypeError: expected str, bytes or os.PathLike object, not int
- ‘coroutine‘ object is not iterable [How to Solve]
- [Solved] TypeError: Object of type ‘bytes’ is not JSON serializable
- [Solved] python-sutime Error: the JSON object must be str, bytes or bytearray, not ‘java.lang.String‘
- TypeError: Decimal type object is not a JSON serialization solution
- Keras import a custom metric model error: unknown metric function: Please ensure this object is passed to`custom_object‘
- Python error collection: NameError: name ‘numpy’ is not defined
- [Solved] Python 3.6 Error: ‘dict’ object has no attribute ‘has_key’
- [Solved] Python serializate error: NameError: name ‘JSON’ is not defined
- Typeerror in Python regular expression: expected string or bytes like object
- Python parsing JSON Error: NameError: name ‘false’ is not defined
- [How to Fix]RuntimeError: Python is not installed as a framework, If you are using (Ana)Conda
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- [Solved] Python Error: object too deep for desired array.
- [Modified] AttributeError: ‘socket‘ object has no attribute ‘ioctl‘ python linux
- How to Solve Python AttributeError: ‘dict’ object has no attribute ‘item’
- Python Openyxl Error: AttributeError: ‘int‘ object has no attribute ‘upper‘ [How to Solve]
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]