TypeError: 'int' object is not callable

这个错误的原因很简单

看下面的程序:

 def loss(a,b):
return a-b loss = 0
loss = loss(5,2)+1

错误定位:

loss = loss(5,2)+1
TypeError: 'int' object is not callable

原因:

函数名loss

变量名loss

重合!!!

以此类推到其他类型的错误

python TypeError: 'int' object is not callable 问题解决的更多相关文章

  1. 调用日志输出错误:TypeError: 'int' object is not callable等

    *)TypeError: 'int' object is not callable 错误信息: Traceback (most recent call last): File "Visual ...

  2. Python TypeError: 'module' object is not callable 原因分析

    今天尝试使用pprint进行输出,语句为 >>>import pprint >>>pprint(people) 结果报错,TypeError: 'module' o ...

  3. Python: TypeError: 'dict' object is not callable

    问题:  TypeError: 'dict' object is not callable 原因:  dict()是python的一个内建函数,如果将dict自定义为一个python字典,在之后想调用 ...

  4. python -- TypeError: 'module' object is not callable

    文件: 代码: import pprintmessge = 'It was a bringht cold day in April,and the clocks were striking thrir ...

  5. Python : TypeError: 'int' object is not iterable

    用循环依次对list中的每个名字打印出 Hello, xxx! -------------------------------------------------------- L = ['Bart' ...

  6. python 报错——Python TypeError: 'module' object is not callable 原因分析

    原因分析:Python导入模块的方法有两种: import module 和 from module import 区别是前者所有导入的东西使用时需加上模块名的限定,而后者则不需要 例: >&g ...

  7. python import 错误 TypeError: 'module' object is not callable

    python import 错误 TypeError: 'module' object is not callable 在这里,有 Person.py test.py; 在 test.py 里面 im ...

  8. python Flask :TypeError: 'dict' object is not callable

    flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...

  9. Python学习笔记1 -- TypeError: 'str' object is not callable

    Traceback (most recent call last): File "myfirstpython.py", line 39, in <module> pri ...

随机推荐

  1. jstl标准标签库 其他标签

    url操作标签 import 将另一个页面的内容引入到这个页面上来, 与include指令的区别: 这个标签可以引入其他项目中甚至网络上的资源 <c:import url="被导入的路 ...

  2. 工欲善其事,必先利其器-ecplise配置和优化

    1.eclipse下的编码设置:eclipse 中使用模板新建 JSP,xhtml等 文件时,默认的编码为:ISO-8859-1. ISO-8859-1 编码对于中文的显示是不支持的,如果要支持简体中 ...

  3. Jmeter创建一个web测试计划

    1.  下载Jmeter 下载地址:http://jmeter.apache.org/download_jmeter.cgi 下载后解压到你想“安装”的路径下,比如: D:\Program Files ...

  4. mysql 递归查找菜单节点的所有子节点

    背景                                                                                                   ...

  5. PHP开发——数据类型

    概述 l  变量就是一个容器,变量本身并没有类型,变量的类型解决值的类型. l  PHP和JS都属于弱类型语言,变量在运行过程中,类型是可以变的.但是,Java不可以. l  标量(基本)数据类型:字 ...

  6. C# 检测证书是否安装、 安装证书

    检测是否存在指定的证书: /// <summary> /// 检测是否存在指定的证书 /// </summary> /// <returns></return ...

  7. Failed to connect to 127.0.0.1 port 1080: Connection refused package 问题解决方法

    错误: fatal: unable to access 'https://github.com/******': Failed to connect to 127.0.0.1 port 1080: C ...

  8. tab选项卡实例

    之前也见了不少的tab选项卡,但是下面这个选项卡是一个页面中有多个时互不影响的. <head> <meta charset="utf-8"> <met ...

  9. 【java】:Junit

    创建单元测试文件 点击创建测试文件的目录,比如,我要在control目录下添加一个测试类,点击control文件夹 右键->new->other->junit test case 下 ...

  10. 别人的Linux私房菜(12)正则表达式与文件格式化处理

    vi gerp awk sed支持正则表达式   cp ls不支持,只能使用bash本身的通配符 正则表达式分为基础正则表达式和拓展正则表达式 使用正则表达式注意语系的影响 http://cn.lin ...