python报以下错误:TypeError: 'int' object is not subscriptable
原因:数组忘了写下标,数组某项赋值成了 数组对象=数字;
查询其它人的博客,发现仍有其它可能引发此错误,无非是不可以相互操作的对象进行了操作或者是访问对象的方式不对,如:给数字加了下标,对一维数组加了两层索引等等
python报以下错误:TypeError: 'int' object is not subscriptable的更多相关文章
- python报错:TypeError: 'int' object is not subscriptable
检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如: a = 4 c=a[2] 报错:line 2, in <module> c=a[2] TypeError: 'i ...
- python: "TypeError: 'type' object is not subscriptable"
目前stackoverflow找到两种情况的解决办法: 1.TypeError: 'type' object is not subscriptable when indexing in to a di ...
- python TypeError: 'int' object is not callable 问题解决
TypeError: 'int' object is not callable 这个错误的原因很简单 看下面的程序: def loss(a,b): return a-b loss = 0 loss = ...
- python import 错误 TypeError: 'module' object is not callable
python import 错误 TypeError: 'module' object is not callable 在这里,有 Person.py test.py; 在 test.py 里面 im ...
- 调用日志输出错误:TypeError: 'int' object is not callable等
*)TypeError: 'int' object is not callable 错误信息: Traceback (most recent call last): File "Visual ...
- Python : TypeError: 'int' object is not iterable
用循环依次对list中的每个名字打印出 Hello, xxx! -------------------------------------------------------- L = ['Bart' ...
- Debug 路漫漫-11:Python: TypeError: 'generator' object is not subscriptable
调试程序,出现以下错误: Python: TypeError: 'generator' object is not subscriptable “在Python中,这种一边循环一边计算的机制,称为生成 ...
- python类型错误:'NoneType' object is not subscriptable
TypeError: 'NoneType' object is not subscriptable --> 原因:变量使用了系统内置的关键字list 解决:重新定义下这个变量
- TypeError: 'NoneType' object is not subscriptable
运行,显示TypeError: 'NoneType' object is not subscriptable错误信息,原因是变量使用了系统内置的关键字list 重新定义下这个变量就好了
随机推荐
- node中间件概念
中间件就是请求req和响应res之间的一个应用,请求浏览器向服务器发送一个请求后,服务器直接通过request定位属性的方式得到通过request携带过去的数据,就是用户输入的数据和浏览器本身的数据信 ...
- AutoCompleteExtender 使用示例
绑定 KeyValuePair,网上很多例子,没有找到绑定键值对的,msdn上有例子,备忘一下. using FirstElite.Verify.Entity; using System; using ...
- Battle Zone 战争地带
发售年份 1980 平台 街机 开发商 雅达利(Atari) 类型 射击 https://www.youtube.com/watch?v=Ctr54kopo8I
- HanLP vs LTP 分词功能测试
文章摘自github,本次测试选用 HanLP 1.6.0 , LTP 3.4.0 测试思路 使用同一份语料训练两个分词库,同一份测试数据测试两个分词库的性能. 语料库选取1998年01月的人民日报语 ...
- 【java】异常
异常体系:Throwable ---Error 通常出现重大问题:如类不存在或者内存溢出.停止运行,不对代码进行处理 ---Exception 在运行时出现的情况,可以进行针对性处理.可以通过try ...
- python3-基础2
数据类型:数字 .字符.列表.字典.集合 字符串: 要用引号引起来 单引号 双引号 三引号 字符串只能存一个值,没有单独字符一说 取字符串值 print(name[0]) 中括号表示 常用 ...
- MFC 使用Skin++ 美化皮肤
查了好几天关于MFC应用程序换肤的资料,经过各种莫名其妙的问题的困扰,现分享一下自己的体会.希望可 以避免一些弯路.另外会在附上一些资源. 环境:Windows 7 + VS2012 + SkinSh ...
- Java核心-多线程-并发控制器-Semaphore信号量
Semaphore是非常有用的一个多线程并发控制组件(Java还有CountDownLatch.CyclicBarrier.Exchanger多线程组件),它相当于是一个并发控制器,是用于管理信号量的 ...
- petapoco模板修改
[Reference(ReferenceType.Many, ColumnName = "OneId", ReferenceMemberName = "OneId&quo ...
- VMware 12 安装 Windows server 2008 系统
一.准备工作 安装了VMware 12 的PC 准备windows server 2008 的ISO操作系统文件 官网地址:https://www.microsoft.com/en-us/downl ...